Are*_*ren 11
我相信你在寻找:
Process p = Process.Start("myapp.exe");
p.WaitForExit();
Run Code Online (Sandbox Code Playgroud)
输出:
StreamReader stdOut = p.StandardOutput;
Run Code Online (Sandbox Code Playgroud)
然后你像任何流阅读器一样使用它.
为了抑制窗口,它有点难:
ProcessStartInfo pi = new ProcessStartInfo("myapp.exe");
pi.CreateNoWindow = true;
pi.UseShellExecute = true;
// Also, for the std in/out you have to start it this way too to override:
pi.RedirectStandardOutput = true; // Will enable .StandardOutput
Process p = Process.Start(pi);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2740 次 |
| 最近记录: |