摘要:
1 System.IO.TextWriter old = System.Console.Out; //备份原来的stream 2 using (System.IO.TextWriter w = System.IO.File.CreateText("log.txt")) 3 { 4 System.Console.SetOut(w); 5 System.Console.WriteLine("123"); 6 } 7 8 System.Console.SetOut(old); 9 10 System.Diagnostics.Process.Start(&quo 阅读全文