I found this tutorial on how getting Idle time of the user Idle Time.
The problem is that it will only work if the application runs on the user.
And my application runs on SYSTEM.
How can I get the idle time? or if PC is idle?
I know this answer has already been accepted but I just wanted to add this in case people wanted to do the same thing in a Terminal Services enviroment.
Cassia is a open source library that puts .NET wrappers around the Windows Terminal Services API. I have used it for my server management and it works really well. You can get the idle time for any session by calling ITerminalServicesSession.LastInputTime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With