先載入兩個system的dll
imports system
Imports System.Diagnostics
Dim sSource As String = "dotNET Sample App"
Dim sLog As String = "Application"
Dim sEvent As String = "Sample Eventgg"
Try
If (EventLog.SourceExists(sSource)) Then
EventLog.CreateEventSource(sSource, sLog)
End If
'*此為靜態寫入event log*
EventLog.WriteEntry(sSource, sEvent)
EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning, 234)'**234警告標語,1054錯誤標語
Catch ex As Exception
msgbox(ex.message)
End Try
文章標籤
全站熱搜
