Some thing like:
Dim logName As String
If EventLog.SourceExists("MyOldSource", "myServer") Then
logName = EventLog.LogNameFromSourceName("MyOldSource",
"myServer")
EventLog.DeleteEventSource("MyOldSource", "myServer")
EventLog.Delete(logName, "myServer")
Console.WriteLine((logName & " deleted."))
End If
but the above code remove all events from Application category. I only want
to remove a subset of events specified by the source.
"Herfried K. Wagner [MVP]" wrote:
"Li Pang" <Li****@discussions.microsoft.com> schrieb: I write some message into application events under a specific source. I
want
to know how to programmatically clean up the messages within this source?
Which messages?! Are you talking about comments?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>