日期:2014-05-17  浏览次数:20492 次

IIS配置的ASP.net网站,不能打开本地的exe文件,直接在visual studio上运行正常
我用visual studio 2010 写了一个网站,在Page_Load时,用下面的方式打开一个本地的exe文件
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileNmae = "C:\\a.exe";
process.StartInfo.CreateNoWindow = true;
process.Start();

直接在vs上运行的时候没问题。

当我配置到IIS6.0上以后,运行网页,发现a.exe的程序进程能在任务管理器中发现,但是只是一个进程,a.exe的功能却没有了。

希望哪位大神能给解决了,不会这个。谢谢。
IIS ASP.NET IIS中ASP.NET运行本地exe程序

------解决方案--------------------
你把IIS服务的登录用户名改为Administrator再试试?

In addition to setting this registry key, the service application must be marked as "interactive". This allows your service to interact with the desktop, and allows the debugger window to appear on your desktop.

This again requires modifying a registry key: you must bitwise-or the type entry for your service with 0x100 (this is the value for SERVICE_INTERACTIVE_PROCESS according to Winnt.h). The exact location and name of this registry entry varies. For example:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyServiceKey

------解决方案--------------------
引用:
Quote: 引用:

一般是没有权限的问题。
看看你的IIS账户是什么权限,假如administrators组试试!
这个咋搞?仔细点,行不,我没玩过这个。我的是IIS6.0,我吧应用程序池,里面的DefaultAppPool的标识,改成本地系统,都不行,然后改成配置下面的用户名:Administration 加密码,结果 访问网站,直接 no servers 不能访问了。

VS运行的时候是以管理员账户运行的。
在IIS上的配置的网站上右键 -> 属性 -> 主目录 -> 执行权限 -> 选择执行和可执行文件。
然后重启IIS 再试试!