Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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

  • 08-02-2006 8: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,689 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