public static Run ( string fileName, string arguments ) : void | ||
fileName | string | |
arguments | string | |
리턴 | void |
public static void Run(string fileName, string arguments)
{
using (var process = CreateProcess(fileName, arguments))
{
process.Start();
var output = process.StandardOutput.ReadToEnd();
var error = process.StandardError.ReadToEnd();
process.WaitForExit();
Console.WriteLine(output);
if (!String.IsNullOrEmpty(error))
throw new ApplicationException(error);
}
}