Can you execute another EXE file from within a C# console application?
Can you execute another EXE file from within a C#开发者_Go百科 console application?
- Can you pass arguments?
- Can you get the exit code back?
Like this:
var proc = new Process();
proc.StartInfo.FileName = "something.exe";
proc.StartInfo.Arguments = "-v -s -a";
proc.Start();
proc.WaitForExit();
var exitCode = proc.ExitCode;
proc.Close();
精彩评论