Option Explicit
Option Strict
Imports System
Imports System.Diagnostics
Imports System.Threading
Class MySample
Public Shared Sub Main()
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
End Sub
End Class