I have an application that works according to time, i.e. it behaves differently during certain hours and in a different manner other hours. But a user can change the system time and the application will fail(behave depending on the system time not the actual time). How to avoid this?
How to get the actual time even if the user changes the system time?
The user with administrator rights of the application sets a time period during which certain features of the application will be blocked. A normal user cannot use those blocked features during that time period fixed by the administrator but at other times he can use them. So during the actual blocked time period the normal user can change the system time to that time when he can use those features and can use it. I want to avoid this.
e.g.
time set by Admin
allowed time period: 11 pm to 6 am
blocking time period: 6 am to 11 pm
now suppose it is 3 pm and the system clock is showing the correct time. My application checks the system time and blocks those features. But if the user changes the system time to say 11:30 pm he can use those features as they are no more blocked.
1. The "the normal user" in the "normal" network should not have any permissions to change system time.
2. Who is supposed to start/close your program? The Admin? Or any "normal user"?
It is a desktop application that asks for password at its startup. If correct password is entered, admin is the user, if password is wrong or no password is entered, its normal user.
The person who installs the application will set the admin password and he is the admin.
Anybody can change the system time of a desktop.
Is there intranet? Can you get a correct time from a local server?
If not - I am afraid there can't be a solution. Your system is isolated and you don't trust its clock...
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio: FeinViewer - an integrated GDI objects viewer for Visual C++ Debugger, and more...
Okay, the app could save the timestamp each time it validates the one, and prevent it from rolling back by stopping functioning. The function can be moved to a special server app the main app to communicate with. BTW, no guaranty against skilled hacker, and daylight saving time to be processed correctly.
Bookmarks