C# Error Using EventViewer [modified]
-
Hi All I use C#.Net To Create Windows Application system I want to save the problems resulting from the system in the Right Click On My Computer-> Manage -> Event Viewer -> Application Error How can I do this Thanks :rose:
Thaer
modified on Sunday, June 7, 2009 8:15 AM
-
Hi All I use C#.Net To Create Windows Application system I want to save the problems resulting from the system in the Right Click On My Computer-> Manage -> Event Viewer -> Application Error How can I do this Thanks :rose:
Thaer
modified on Sunday, June 7, 2009 8:15 AM
using System.Diagnostics;
EventLog ApplicationEventLog = new System.Diagnostics.EventLog();
ApplicationEventLog.Source = "My application name here";
ApplicationEventLog.WriteEntry("My message here", EventLogEntryType.Error);You should have a look at the docs for
EventLog
, you will see you can specify many more options. :)2+2=5 for very large amounts of 2 (always loved that one hehe!)