I am having difficulty in writing to the windows event logs. I am specifically trying to write to the application log.
The test code I am working with is;
Dim sSource As String
Dim sLog As String
Dim sEvent As String
Dim sMachine As String
sSource = "dotNET Sample App"
sLog = "Application"
sEvent = "Sample Event"
sMachine = "."
If Not EventLog.SourceExists(sSource, sMachine) Then
EventLog.CreateEventSource(sSource, sLog, sMachine)
Dim ELog As New EventLog(sLog, sMachine, sSource)
ELog.WriteEntry(sEvent, EventLogEntryType.Warning, 234, CType(3, Short))
some of the code is identified as being obsolete, unfortunatly I cannot find documentation at MSDN for the replacement code. Further there is an issue with a system.securityexception