System events

  • Thread starter Thread starter spp
  • Start date Start date
S

spp

How can I save the contents of System events into a new file and the clear
this event log.
I want to do programaticaly something like using event viewer with Save Log
File As... and then Clear all events.
 
Hi,

You can use EventLog classes in System.Diagnostics.
First create an instance of EventLog component and then set the necessary properties to configure it. For this, check out these MSDN articles:

1. Creating EventLog Component Instances
2. Configuring EventLog Component Instances
3. Walkthrough: Exploring Event Logs, Event Sources, and Entries

Finally call the EventLog.Clear method to clear the log.
Hope this helps.

Thanks
Mona [GrapeCity]
 
Back
Top