Results 1 to 8 of 8

Thread: System Event Logs

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    South Africa
    Posts
    28

    Question 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

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    hold on..i am wrwoking on some code for ya thate should work
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    South Africa
    Posts
    28

    Thumbs up Found it!

    Yip found it looks like I mighht be able to use it. Just have to figure out this Server Explorer first.

    Thanx

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    myLog.Entries should be log.Entries
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    South Africa
    Posts
    28

    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.

  8. #8
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    ok cool..Well I just tried it out and it worked perfectly. Not bad for a complete guess.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width