using System.Diagnostics;
public class Sample
{
public static void Main(string[] args)
{
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
myWriter.Write("Write to console screen. ");
myWriter.WriteLine("Again, write to the Console screen.");
myWriter.Flush();
myWriter.Close();
}
}
|