Open EventLog

  • Thread starter Thread starter João Santa Bárbara
  • Start date Start date
J

João Santa Bárbara

Hi all
i have made an aplication, that uses Eventlog object, my problem is
i need to open the eventlog in my aplication with all entrys how can i do
this ?

thks
JSB

PS : i need to open the window in my aplication with all events that i have
written .. :D
 
Hi,

Module Module1
Sub Main()
Dim evl As New EventLog("Application")

Dim str As String

str = "No entries: " & evl.Entries.Count
Console.WriteLine(str)


For Each entry As EventLogEntry In evl.Entries
Dim strEntry As String
strEntry = String.Format("{0} {1}", entry.EventID, entry.Source)
Console.WriteLine(strEntry)
Next

Console.WriteLine(str)
End Sub
End Module

Ken
 
thks .. :D

Ken Tucker said:
Hi,

Module Module1
Sub Main()
Dim evl As New EventLog("Application")

Dim str As String

str = "No entries: " & evl.Entries.Count
Console.WriteLine(str)


For Each entry As EventLogEntry In evl.Entries
Dim strEntry As String
strEntry = String.Format("{0} {1}", entry.EventID, entry.Source)
Console.WriteLine(strEntry)
Next

Console.WriteLine(str)
End Sub
End Module

Ken
 
Back
Top