Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - How to call an exe added into project solution

Tags:

c#

executable

So I added an EXE to my project's solution. The EXE does some stuff and outputs data via stdout. I want to capture the output, but more importantly how do I execute that EXE within my program?

like image 241
user40856 Avatar asked Nov 25 '08 23:11

user40856


1 Answers

Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "myExec.exe";
p.Start();
like image 158
Alan Avatar answered Oct 24 '22 19:10

Alan