-
System Event Logs
I am currently busy working on an intrusion detection system. I am looking at using VB.Net for creating a Windows Service. This service will have to read entries from the 3 operating system event logs, namely the Application, System and Security logs. This logs are only available in Win NT, 2000 and XP. Firstly can this be done using VB.Net and secondly does anyone know of good documentation on the subject.
Thanx
-
System.Diagnostics.EventLog is the namespace you can use.
Try doing an internet search for that. There is a method called GetEVentLogs that might be what you need. It returns an Eventlog array you would probably have to loop through and turn into a string. That is as much as I know about it though.
-
hold on..i am wrwoking on some code for ya thate should work
-
Found it!
Yip found it looks like I mighht be able to use it. Just have to figure out this Server Explorer first.
Thanx
-
Code:
Dim log As New System.Diagnostics.EventLog()
Dim logentry As System.Diagnostics.EventLogEntry
log.Log="Application"
For Each logentry in myLog.Entries
MessageBox.Show(logentry.Message)
Next logentry
give that a shot
-
myLog.Entries should be log.Entries
-
I will give it a shot!
Thanx not working on PC with .Net on. Will test the code tonight.
But I am certain it will work.
-
ok cool..Well I just tried it out and it worked perfectly. Not bad for a complete guess. :)