
Here's some code that will log a message in an event viewer:
EventLog EventLog1 = new System.Diagnostics.EventLog();
if (!EventLog.SourceExists("Name"))
EventLog.CreateEventSource(
"Name", "Application");
EventLog1.Source = "Name";
EventLog1.WriteEntry(message.ToString(), EventLogEntryType.Error);











0 comments:
Post a Comment