if (!EventLog.SourceExists("MySource")) { EventLog.CreateEventSource("MySource","MyNewLog"); } // Create an EventLog instance and assign its source. EventLog eventLog = new EventLog(); // Setting the source eventLog.Source = "MySource"; // Write an entry to the event log. eventLog.WriteEntry("An error has been generated by the application", EventLogEntryType.Error, 1002);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)