先載入兩個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

文章標籤
全站熱搜
創作者介紹
創作者 斷了線的小木偶 的頭像
斷了線的小木偶

斷了線的小木偶的部落格

斷了線的小木偶 發表在 痞客邦 留言(0) 人氣(34)