2010-03-29 8 views

답변

5

ProcessStartInfo.RedirectStandardOutputProcess.StandardOutput을 살펴보십시오.

예 :

compiler.StartInfo.FileName = "csc.exe" 
compiler.StartInfo.Arguments = "/r:System.dll /out:sample.exe stdstr.cs" 
compiler.StartInfo.UseShellExecute = False 
compiler.StartInfo.RedirectStandardOutput = True 
compiler.Start() 

Console.WriteLine(compiler.StandardOutput.ReadToEnd()) 

compiler.WaitForExit() 
+0

안녕 DTB, 답장을 보내 감사합니다. 잘 작동한다고 생각합니다. 유일한 것은 외부 명령이 끝날 때까지 명령 창을 팝업한다는 것입니다. 이 창을 숨기려면 어떻게해야합니까? 고마워요 –

+1

방금 ​​받았어요 : compiler.StartInfo.CreateNoWindow = True –

관련 문제