3
Visual Basic 2008에서 외부 콘솔 (명령 줄) 명령을 실행하고 중간 파일의 도움없이 출력을 얻는 방법 (속도 향상)이 궁금합니다.콘솔 명령을 실행하고 출력을 얻습니다.
Visual Basic 2008에서 외부 콘솔 (명령 줄) 명령을 실행하고 중간 파일의 도움없이 출력을 얻는 방법 (속도 향상)이 궁금합니다.콘솔 명령을 실행하고 출력을 얻습니다.
ProcessStartInfo.RedirectStandardOutput 및 Process.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()
안녕 DTB, 답장을 보내 감사합니다. 잘 작동한다고 생각합니다. 유일한 것은 외부 명령이 끝날 때까지 명령 창을 팝업한다는 것입니다. 이 창을 숨기려면 어떻게해야합니까? 고마워요 –
방금 받았어요 : compiler.StartInfo.CreateNoWindow = True –