How to clean up a source in Application events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

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?

thanks
 
Li Pang said:
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?
 
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.
 

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

Back
Top