我需要的程序給批處理腳本的輸出,而且目前它只是打印沒有給外部批處理腳本C#正確的輸出
System.IO.StreamReader
,它應該是印刷無論批處理腳本說
這是唯一有開始一個新的進程做了一部分,就像文件路徑的變量聲明和腳本本身運行,但並沒有顯示正確的輸出
Process Uninstaller = new Process();
Uninstaller.StartInfo.FileName = Path.Combine(uninstalldirectory, BatchProcessFileName);
Uninstaller.StartInfo.UseShellExecute = false;
Uninstaller.StartInfo.CreateNoWindow = true;
Uninstaller.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Uninstaller.StartInfo.RedirectStandardOutput = true;
Uninstaller.Start();
StreamReader ReadUninstallerOutput = Uninstaller.StandardOutput;
Uninstaller.Close();
string OutputEnd = ReadUninstallerOutput.ReadToEnd();
Console.WriteLine(ReadUninstallerOutput);
ReadUninstallerOutput.Close();
Console.WriteLine("Uninstallation Successful");
你們都說得對,謝謝 – 2009-11-17 02:10:11