C# 標準出力

StreamWriter sw = new StreamWriter("d:\\work\\mbsa.txt", false, Encoding.GetEncoding("Shift_JIS"));

Process process = new Process();
process.StartInfo.FileName = "C:\\Program Files\\Microsoft Baseline Security Analyzer 2\\mbsacli.exe";
//process.StartInfo.Arguments = arguments;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.WorkingDirectory = "";
string temp;
process.Start();
temp = process.StandardOutput.ReadToEnd();
process.WaitForExit(1200000); //wait 20 minites
temp += process.StandardOutput.ReadToEnd();
Console.Out.WriteLine(temp);
sw.WriteLine(temp);
sw.Close();


http://blog.windy.ac/archives/001149.html