10/28/09

Create Event Viewer Log with System.Diagnostics.EventLog



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);

5 comments:

  1. Topcleo
    Topcleo - Your ultimate mobile app 메리트카지노 to play your favourite casino 카지노사이트 games! and play over 200 free slots daily for free! mobile app, How many games does Topcleo have? How many games does Topcleo offer?

    ReplyDelete