by Piyush Gupta (3 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 15th October 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Reading the WindowsNT / Windows 2000 EventLog in VB.NET
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim a As New EventLog()
Dim objEventLog As EventLog.EventLogEntryCollection
Dim objEntry As EventLogEntry
a.Log = "Application"
objeventlog = a.Entries()
For Each objEntry In objEventLog
Textbox1.Text += (objentry.Source & ":" & _
objEntry.TimeGenerated & ":" & _
objEntry.Message) & chr(13) & chr(10)
Next
End Sub