WebアプリケーションからWindowsアプリケーションを呼び出したい。私は以下のコードを試しました:
ここで「AppA_VB」は実行中のデスクトップ アプリです。私はデスクトップアプリの参照を追加した別のWebアプリを持っています。ローカル PC で Web アプリを実行すると正常に動作しますが、公開後ではありません。
AppA_VB.Form1 appAform = 新しい AppA_VB.Form1(); appAform.Show();
var c = GetAll(appAform, typeof(System.Windows.Forms.TextBox));
foreach (System.Windows.Forms.TextBox t in c)
{
if (t.TabIndex == 1)
{
t.Text = TxtName.Text;
}
if (t.TabIndex == 2)
{
t.Text = TxtAddress.Text;
}
if (t.TabIndex == 3)
{
t.Text = TxtStandards.Text;
}
}
var b = GetAll(appAform, typeof(System.Windows.Forms.Button));
foreach (System.Windows.Forms.Button btn in b)
{
if (btn.Text.ToString().ToLower() == "save")
{
btn.PerformClick();
}
}
そして、私もこれを試しました、
System.Diagnostics.Process process1 = 新しい System.Diagnostics.Process();
process1.StartInfo.FileName = Convert.ToString(ConfigurationManager.AppSettings["ExePath"]);
// Start the process
process1.Start();
また、公開後も機能しません。
私がそれに欠けているもの。ありがとう。