Process.Exited event is not be called

前端 未结 1 1809
有刺的猬
有刺的猬 2020-12-21 20:56

I have the following code snippet to call into command line:

p = new Process();
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = \"cmd.exe\";
ps         


        
相关标签:
1条回答
  • 2020-12-21 21:53

    You need to consume the output stream when the standard output has been redirected:

    p.Start();   
    p.StandardOutput.ReadToEnd();
    p.WaitForExit();
    
    0 讨论(0)
提交回复
热议问题