Private Sub Button1_Click (expéditeur de ByVal comme System.Object, ByVal e comme System.EventArgs) Poignées Button1.ClickDim eventLogApp As New System.Diagnostics.EventLog ("Application")
Dim EventLogEntry Comme System.Diagnostics.EventLogEntry
Dim eventCntr As Integer = 1
Pour chaque EventLogEntry Dans eventLogApp.Entries
Me.ListBox1.Items.Add ("Nombre de l'événement:" & eventCntr)
Me.ListBox1.Items.Add (eventLogEntry.EntryType.ToString)
Me.ListBox1.Items.Add (eventLogEntry.TimeGenerated.ToString)
Me.ListBox1.Items.Add (eventLogEntry.Source.ToString)
Me.ListBox1.Items.Add (eventLogEntry.Category.ToString)
Me.ListBox1.Items.Add (eventLogEntry.EventID.ToString)
Me.ListBox1.Items.Add (eventLogEntry.MachineName.ToString)
Me.ListBox1.Items.Add (eventLogEntry.Message.ToString)
Me.ListBox1.Items.Add ("-----------------------------------------------")
eventCntr eventCntr = + 1
Me.ListBox1.Refresh ()
Suivant
End Sub