CCNet.Build.Common.Execute.Run C# (CSharp) 메소드

Run() 공개 정적인 메소드

Runs custom tool and redirects its output to the main process.
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);
			}
		}