System events

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.
 
M

Mona

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top