且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用ProcessStartInfo C#执行脚本

更新时间:2023-01-23 10:11:22

您可以使用计时器检查p是否在一定时间后退出,而不用调用WaitForExit.实际上,我认为WaitForExit可以采用超时值.
You can use a timer to check if p has exited after a certain period of time, instead of calling WaitForExit. Actually, I think WaitForExit can take a timeout value.


能否给我一个使用Win32 API而不使用CSCript.exe的示例吗?

谢谢

Scott
Can you give me an example of using the Win32 API instead of using CSCript.exe?

thanks

Scott


不建议使用"cscript.exe",它将启动新进程,您无法再监视其他进程中的其他进程信息,这需要调用WIN32 API来完成,无法在.net框架中完成
no recommend use "cscript.exe",it will start new proccess, you can''t monitor other process informations more in different process, this need to call the WIN32 API to do, can''t go do in .net framework