Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

VB Catch Statement in Event Viewer.

I am trying to figure out how to change this last piece of code: It seems to show up in the Event Viewer as a Printer:

 ELog.WriteEntry(sEvent, EventLogEntryType.Warning, 234, CType(3, Short))

How can I change this or what can I change it to?

 Catch ex As Exception
            Dim sSource As String
            Dim sLog As String
            Dim sEvent As String
            Dim sMachine As String
            sSource = ""
            sLog = "Application"
            sEvent = "Trigger Action"
            sMachine = "."
            If Not EventLog.SourceExists(sSource, sMachine) Then
                EventLog.CreateEventSource(sSource, sLog, sMachine)
            End If
            Dim ELog As New EventLog(sLog, sMachine, sSource)
            ELog.WriteEntry(sEvent)
            ELog.WriteEntry(sEvent, EventLogEntryType.Warning, 234, CType(3, Short))
            _TListener.AddMethodError(ex)
        End Try

Open in new window

Avatar of Arana (G.P.)
Arana (G.P.)

Can you show us a screenshot of your log viewer with your event in it please?
ASKER CERTIFIED SOLUTION
Avatar of Arana (G.P.)
Arana (G.P.)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial