有没有办法确定我的程序启动的进程崩溃了? 目前,我找到了解决办法是看Process.ExitCode
和检查值:在.NET中检测进程崩溃
this.STProcess = Process.Start(this.CreateProcessStartInfo());
this.STProcess.WaitForExit();
if (STProcess.ExitCode != 0)
{
//raise error event...
}
我想知道是否有这样做的更优雅而准确的方法是什么?
我更喜欢C#中的答案,并且使用P/Invoke也不错。
P.S - 我需要在Windows XP/Vista/7的
看到这些其他帖子:http://stackoverflow.com/questions/2279181/catch-another-process-unhandled-exception 和 http://stackoverflow.com/questions/673036/how-to-handle- a-crash-in-a-process-launch-via-system-diagnostics-process – jmservera 2010-02-22 09:41:24