问题描述
我要打电话从Web应用程序的Windows应用程序。
我想低于code:
i want to call Windows application from Web application.i tried below code :
在这里AppA_VB是我运行的桌面应用程序。
和我有另一个Web应用程序,其中我添加桌面应用程序的参考。
它的工作很好,当我运行在我的本地PC的Web应用程序,但它不是发布之后。
here "AppA_VB" is my running desktop app.and i have another web app, in which i added the reference of desktop app.It's working fine when i run the web app on my local pc, but it's not after publish.
AppA_VB.Form1 appAform =新AppA_VB.Form1();
appAform.Show();
AppA_VB.Form1 appAform = new 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();
}
}
我也试过这一个,
And i have also tried this one ,
的System.Diagnostics.Process过程1 =新的System.Diagnostics.Process();
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
process1.StartInfo.FileName = Convert.ToString(ConfigurationManager.AppSettings["ExePath"]);
// Start the process
process1.Start();
它也没有工作后发布。
It's also not working after publish.
我失踪了。
谢谢你。
What i missing in it.Thanks.
推荐答案
这是(安装的应用程序文件夹)缺少适当的权限。我给它,它工作正常。 :)
It was(Installed app folder ) missing the proper permission. I gave it, it works fine. :)
这篇关于从Web应用程序调用Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!