问题描述
HI,
我有Windows应用程序exe文件,它位于web appication文件夹内的服务器机器中。当我点击网页浏览器gridview中的链接按钮时,必须打开windows form exe文件。
下面是代码:
if(e.CommandName ==EditRow)
{
System.Diagnostics.Process RunProcess = new System.Diagnostics.Process();
RunProcess.StartInfo.CreateNoWindow = true;
RunProcess.StartInfo.UseShellExecute = true;
RunProcess.StartInfo.WorkingDirectory = Request.MapPath(〜/ Folder / );
RunProcess.StartInfo.FileName =Application.exe;
RunProcess.StartInfo.Arguments =MyArgument;
RunProcess.Start( );
}
它在localhost中成功运行,但不能通过服务器在客户端机器上运行。请帮帮我。
谢谢
I have windows application exe file which is located in server machine inside web appication folder. When I click the link button in gridview of web browser, then windows form exe file must be opened.
Below is the code:
if (e.CommandName == "EditRow")
{
System.Diagnostics.Process RunProcess = new System.Diagnostics.Process();
RunProcess.StartInfo.CreateNoWindow = true;
RunProcess.StartInfo.UseShellExecute = true;
RunProcess.StartInfo.WorkingDirectory = Request.MapPath("~/Folder/");
RunProcess.StartInfo.FileName = "Application.exe";
RunProcess.StartInfo.Arguments = "MyArgument";
RunProcess.Start();
}
It is running successfully in localhost, but not working in client machine through server. Please help me on this.
Thanks
推荐答案
function Launch() {
var launcher = new ActiveXObject("Shell.Application");
launcher.ShellExecute("where_is_your_exe\\file.exe", "<%=userId%>", "", "open", "1");
}
并且还更改资源管理器中的安全配置以运行activeX。
and also change the security configuration in explorer to run activeX.
这篇关于如何通过客户端计算机中的服务器在Web浏览器中运行exe。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!