Trying to get StandardOutput after running a console process

后端 未结 2 1197
我在风中等你
我在风中等你 2021-01-23 14:19

I can run a console process using the following C# code. The goal is also to collect all the output from such process:

System.Diagnostics.Process proc = new Syst         


        
相关标签:
2条回答
  • 2021-01-23 14:55

    Seeing as the line you are missing seems like an error message, should you not be looking at Process.StandardError Property

    When a Process writes text to its standard error stream, that text is normally displayed on the console. By redirecting the StandardError stream, you can manipulate or suppress the error output of a process. For example, you can filter the text, format it differently, or write the output to both the console and a designated log file.

    0 讨论(0)
  • 2021-01-23 15:11

    Have you tried redirecting and watching StandardError too? It seem likley that this is output to the error stream.

    0 讨论(0)
提交回复
热议问题