Option Explicit
Option Strict
Imports System
Imports System.Diagnostics
Imports System.Threading
Class MySample
Public Shared Sub Main()
If Not EventLog.SourceExists("MySource") Then
EventLog.CreateEventSource("MySource", "MyNewLog")
Console.WriteLine("CreatingEventSource")
Return
End If
Dim myLog As New EventLog()
myLog.Source = "MySource"
myLog.WriteEntry("Writing to event log.")
End Sub
End Class