C#: Log In History of Windows7 machine
This might seem a strange idea so bear with me.
Every day (Mon-Fri), I wake up, go to work and log in on my PC. I was wondering if it is possible to pull up the details of each log in (mainly I'm interested in the date and the exact time). Then, having such information, I can plot it out on a chart and some interesting patterns might come out. For example, I've noticed that on Mondays I tend to go to work earlier than any other day of the week :) (yeah, I know, resting during the weekends might b开发者_如何学Goe the reason).
Anyway, if anyone knows a way to pull out the log ins on a certain PC and read them in a C# application (WPF, Console etc.) would be great. What would be event greater is if there was some C# library which might alleviate the process.
Any ideas/suggestions are welcome.
Best Regards,
Monthy
You need to get it from Windows Event Log http://msdn.microsoft.com/en-us/library/k6b9a7h8.aspx then filter for log on/log off event.
Anyway, I think writing program that runs every time you log-on (auto-startup) and logs the time you log-on and log-off is easier.
For statistic purpose, you can try RescueTime
You could try pulling the data out of the Event Log.
.NET Framework offer classes to access the Event Log programmatically. Start from the MSDN article on EventLog class.
精彩评论