我想知道CreateProcess调用的程序的运行情况,
比如说运行崩溃、运行超时等。
想根据这些情况结束调用的进程。谢谢指导,多给点可用的C#代码或资料。

解决方案 »

  1.   

    to 运行崩溃
    sample as follows:
    Process myProcess = new Process();
    myProcess.StartInfo.FileName = "your app";
    myProcess.Start();
    StreamReader sr = null;
    do
    {
    sr = myProcess.StandardError;

    Debug.WriteLine( sr.ReadToEnd() );
    }
    while( !myProcess.HasExited );
      

  2.   

    to 运行超时
    对于它,本身process没有什么好的方法,不过你可以记录process的起始时间,然后自行控制
      

  3.   

    我通过CreateProcess函数进程已经运行,那该怎么处理呢?
      

  4.   

    我有个例子,不知道是不是你想要的,你自己先看看吧
    http://blog.csdn.net/Knight94/archive/2006/03/21/631196.aspx