System Event Log Manager
The following code will explain you how to handle the system Event log.
It will show how to write the event log and how to get the event log.
Name Space part
In the above namespaces using System.Diagnostics is used for event log.
Create an Event log.
We can create the event log by using the class EventLog.
MyEventLog.WriteEntry has the following options
EventLog.WriteEntry(Registered event source,Event entry message, Event type ,Application-specific ID,Application-specific category, Event data );
The follosing code is used to create an event log
EventLog MyEventLog = new EventLog();
MyEventLog.log = "Application";
MyEventLog.Source = "www.Dotnetspider.com";
MyEventLog.WriteEntry("The member enterd into the webpage");
We can get the Event log entries by using the following code
The following code will display 100 events in the log
for(int i = 0; i < 100; i++)
The following code is used to close the event log.