开发者

create a windows logger

开发者 https://www.devze.com 2023-01-20 06:40 出处:网络
hi i want 开发者_开发技巧to create an application that logs these items: windows turn on, turn off time

hi i want 开发者_开发技巧to create an application that logs these items:

  • windows turn on, turn off time
  • log in, log out time
  • hibernate time
  • restart time

in windows 7 'Admin event viewer' log most of above item but in windows xp there is not a clear log.

in addition, the user can change event setting

how i can do this with fully trust.

Thank you all friends


As you observed, Windows is already logging these events and recording them in the Windows event log that you can view by using the Event Viewer.

In addition, you can write programs to read items from the event log as well as log additional events that you define.

As for security, if your users are running as normal users (Under XP, Vista or Windows 7; it doesn't matter) and not as administrative users then they will not be able to delete items from the event log.

Finally if you are on a network you can use the Event Viewer to look at the log on any of the Windows computers, not just the one you are sitting at. Similarly you can write a program that collects log data from all of the computers on the network (that are turned on) and analyze it for you.


You need to look at WMI to hook into Windows and read the event viewer as JonnyBoats suggests:

http://www.csharphelp.com/2006/10/wmi-made-easy-for-c/

0

精彩评论

暂无评论...
验证码 换一张
取 消