Mega Code Archive

 
Categories / C# Tutorial / Development
 

Tracing To EventLog

using System; using System.IO; using System.Diagnostics; class MainClass {   [STAThread]   static void Main(string[] args)   {     //You can change the listener with the following code     EventLogTraceListener EventListener = new EventLogTraceListener("MyApp");     Trace.Listeners.Add(EventListener);          Trace.WriteLine("My Trace String To Console");          } }