开发者

ASP.NET|Process Class- Runing And Stoping Process

开发者 https://www.devze.com 2023-03-28 07:51 出处:网络
few days ago, my freind asked me to build him a proagram that start and stop process. so, as easy as it is. i did the next code:

few days ago, my freind asked me to build him a proagram that start and stop process.

so, as easy as it is. i did the next code:

(using System.Diagnostics)

Process process;
process = Process.start("SOMEONE.exe");
Process.Kill();

Now, thats it the easy part. everything works. but. when i do the same code in asp.net, its strat the process, but when you kill the process, nothing happnd. no 开发者_Python百科matter what i did, any one have any solion to the next problem :(?


From MSDN:

The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.


AppPool in IIS needs to run under LOCAL Account - otherwise ASP.NET doesn't have enough rights to start/stop processes on the server.

0

精彩评论

暂无评论...
验证码 换一张
取 消