如何运行在项目中添加的exe

Man*_*ish 1 .net c#

首先,我确实看了一下这个.但我没有得到解决方案.

接受的anser说要像这样使用它:

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)

但这不适合我.异常的消息说"系统找不到指定的文件".

我错过了什么吗?我直接将exe添加到项目本身.

moo*_*000 7

你检查.exe是否真的存在吗?即在bin\Debug文件夹中?(假设调试版本).

您可以通过Visual Studio中的属性将.exe设置为复制到输出目录.