从ASP.NET启动外部进程(Starting external process from ASP.NET)

编程入门 行业动态 更新时间:2024-10-09 18:20:13
从ASP.NET启动外部进程(Starting external process from ASP.NET)

我需要从我的Web应用程序启动外部进程。 这意味着使用System.Diagnostics.ProcessStartInfo来调用并执行控制台应用程序(exe)。 但是,我需要以某种方式确保在执行期间没有出错并知道应用程序何时完成其工作。

什么是捕获所有可能的错误并找出它何时完成的最佳方法?

I need to start an external process from my web application. This means using System.Diagnostics.ProcessStartInfo to call out and execute a console app (exe). But I then need to somehow make sure nothing went wrong during it's execution and know when the application completed its work.

What's the best way to both catch all possible errors and find out when it's completed?

最满意答案

我当然希望你能控制外部应用程序的代码,否则你会遇到很多麻烦。 最重要的是要确保该应用程序无法挂起而不能终止。

然后,您可以使用WaitForExit(),ExitCode,StandarError,StandardOut来“捕获所有可能的错误并找出它何时完成”

I sure hope you have control of the code for the external application or you are in for a lot of headaches. The MOST important thing to do is make sure there is no way for that application to hang and not terminate.

You can then use the WaitForExit(), ExitCode, StandardError, StandardOut to "catch all possible errors and find out when it's completed"

更多推荐

本文发布于:2023-08-04 20:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1421472.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:进程   NET   ASP   process   external

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!