Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

How to connect to event viewer using asp.net???

  • 08-02-2006 09:35AM
    #1
    Closed Accounts Posts: 9


    I am looking to set up a simple program that will record when a user logs into a laptop. The results will display in a table showing the date and time stamp of when the user last logged in.

    I have set up the database in SQL to record all results and the .aspx dislpay page but now i need to configure it to take info from the login file in event viewer, but thats where the problem lies. I dont know how to set up a connection to event viewer!! Any ideas??:(


Comments

  • Moderators, Society & Culture Moderators Posts: 9,688 Mod ✭✭✭✭stevenmu


    The System.Diagnostics.EventLog component (under Components in the toolbox in VS if you have it) lets you interact with the event log. I've only used it to write events out to the log so I don't have the exact code you'll need, but I think you'll need to set the 'Log' property to point to the log you want (Application Log, System Log etc), and you can then use the 'Entries' property to loop through all existing entries.
    For Each logentry As System.Diagnostics.EventLogEntry In EventLog1.Entries
                messagebox.show(logentry.Source)
                messagebox.show(logentry.Message)
                'etc
    Next
    




    (ps Programming Forum)


Advertisement