C# 如何确定流程启动正常

C# 如何确定流程启动正常,c#,process,system.diagnostics,C#,Process,System.diagnostics,我正在试图找出是否有一种好方法可以知道进程是否正确启动。 我使用以下代码: if (!_process.Start()) { throw new Exception("Component {0} failed to start.".FormatWith(component.Name)); } if (!_process.IsMyProcessRunning()) {


我正在试图找出是否有一种好方法可以知道
进程是否正确启动。
我使用以下代码:

        if (!_process.Start())
        {
            throw new Exception("Component {0} failed to start.".FormatWith(component.Name));
        }

        if (!_process.IsMyProcessRunning())
        {
            throw new Exception("Component {0} failed to start.".FormatWith(component.Name));
        }

static public class MyExtensions
{
    public static bool IsMyProcessRunning(this Process process)
    {
        return !process.HasExited && process.Id != 0 ;
    }
}
我猜
Start()
方法速度更快,有时会出现异常,有时则不会。我的进程正在启动一个出错的程序