C# cmd 명령어 실행 & 내용 출력


C# cmd 명령어 실행 & 내용 출력

public string RunExecute(string strKey, string file) { ProcessStartInfo pri = new ProcessStartInfo(); Process pro = new Process(); pri.FileName = @"cmd.exe"; pri.CreateNoWindow = true; pri.UseShellExecute = false; pri.RedirectStandardInput = true; //표준 출력을 리다이렉트 pri.RedirectStandardOutput = true; pri.RedirectStandardError = true; pro.StartInfo = pri; pro.Start(); //어플리케이션 실 pro.StandardInput.Write(strKey + Environment.NewLine); pro.StandardInput.Close(); System.IO.StreamReader sr = pro.StandardO...


#cmd #streamreader

원문링크 : C# cmd 명령어 실행 & 내용 출력