Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading EventLog - how to?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
566
0
16
US
Taken/adjusted from
Code:
Dim myLog As EventLog = new EventLog()
Dim lsRetStr As String = ""

For Each loEntry As EventLogEntry In myLog.Entries
	lsRetStr += loEntry.Message + ", UN = " + loEntry.UserName + vbCrLf
Next

2024-04-04_EventLog_Errs_gnlrln.jpg


What am I missing?

AHWBGA!

Regards,

Ilya
 
As the error says
[pre]Log property value has not been specified.[/pre]
before your for-each-loop you need to specify the property value myLog.Log, e.g.
[pre]myLog.Log = "System"[/pre]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top