deleting eventlog
Posted
by user311130
on Stack Overflow
See other posts from Stack Overflow
or by user311130
Published on 2010-04-27T20:41:54Z
Indexed on
2010/04/27
20:43 UTC
Read the original article
Hit count: 435
eventlog
Hey,
How can I delete a specific eventlog entry (say id 130 with source: Myprog) or delete all eventlogs from a specific source without deleting the whole eventlogs under "Application" folder?
public static void deleteEvent()
{
string logName;
if (EventLog.SourceExists(SOURCE))
{
logName = EventLog.LogNameFromSourceName(SOURCE, ".");
EventLog.Delete(logName);
}
}
I tried the following code, but it deleted all the eventlogs under "Application".
Cheers,
© Stack Overflow or respective owner