気にしないでください・・・汗
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
EVTWrite("PJWB411", "テスト用メッセージ", EventLogEntryType.Error)
EVTWrite("PJWB411", "テスト用メッセージ", EventLogEntryType.Information)
End Sub
Public Sub EVTWrite(ByVal pi_APP As String, ByVal pi_MSG As String, ByVal pi_type As EventLogEntryType)
Dim sEvent As String
Dim sData As New EventSourceCreationData(pi_APP, "Application")
sEvent = pi_MSG
sData.MachineName = "."
If Not EventLog.SourceExists(sData.Source, sData.MachineName) Then
EventLog.CreateEventSource(sData)
End If
Dim ELog As New EventLog(sData.LogName, sData.MachineName, sData.Source)
ELog.WriteEntry(pi_MSG, pi_type)
End Sub