C# - 如何调用添加到项目解决方案中的exe

use*_*856 6 c# executable

所以我在项目的解决方案中添加了一个EXE.EXE通过stdout执行一些操作并输出数据.我想捕获输出,但更重要的是如何在我的程序中执行EXE?

Ala*_*lan 7

Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "myExec.exe";
p.Start();
Run Code Online (Sandbox Code Playgroud)

  • 虽然相关文件路径仅在当前工作目录未更改时才有效... (2认同)