I'm working with a WPF/C# app where I need to lock out users from accessing a particular feature for some amount of time. Basically, from the time a certain event happens, I want to prevent certain access for the next 24 hours.
The simple case:
- Event happens, save timestamp (using DateTime or similar)
- User tries to access area 15 hours later, compare Now to timestamp... block
- User tries to access area 25 hours later, compare Now to timestamp... allow
All good. However, the user has the ability to change the system time, which royally screws me. They can simply set the system time 24 hours ahead and my app will be none the wiser.
I'm assuming that changing the time in Windows makes its way to the system's real time clock... so is there any free running timer that is independent of the system clock? One that the user can't mess with?
Any insight is appreciated.