tags:

views:

19

answers:

0

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,

related questions