我需要在网站上的按钮单击事件上触发Windows应用程序. [英] I need to trigger a windows application on the button click event on a website.
本文介绍了我需要在网站上的按钮单击事件上触发Windows应用程序.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我需要在网站上的按钮单击事件上触发Windows应用程序.
我使用了以下代码,
Hi All,
I need to trigger a windows application on the button click event on a website.
I have used following code ,
protected void Button1_Click1(object sender, EventArgs e)
{
if (calcProc != null)
calcProc.Kill();
calcProc = new Process();
ProcessStartInfo i = new ProcessStartInfo();
i.FileName = ConfigurationManager.AppSettings["path"]; ; // Code here your win-apps path -- path will be pointing to windows application EXE.
i.RedirectStandardOutput = true;
i.RedirectStandardInput = true;
i.RedirectStandardError = true;
i.CreateNoWindow = true;
i.UseShellExecute = false;
calcProc.StartInfo = i;
calcProc.Start();
}
发布前一切正常,
在ISS中发布后,它不起作用,
单击按钮时出现一些弹出错误消息.
请帮助我,谢谢..
It''s working fine before publishing,
After publishing in ISS ,It''s not working,
Getting some popup error msgs on the button click.
Help me , thanks in advance..
推荐答案
您的路径值包含什么?
是相对路径还是绝对路径?
如果绝对,请确保该文件在服务器上(位于所需位置).
What does your path value contain?
Is it a relative path or absolute?
If it is absolute, make sure this file exists on the server (at the desired location).
这篇关于我需要在网站上的按钮单击事件上触发Windows应用程序.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文