Syncronise the system Date through c# code
-
Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep
-
Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep
Sychronize the system date/time with what?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep
In addition to the constraint you've applied, add another flag in the registry, which tells you if the product has expired or not. Initially, it should be false, but after the first time the user has used the product for more than X days, make it false. After this, even if the user manipulates the system time, the second condition will fail. Possibly better way to do it: I While installing, set lastUsedDate to the current date and usedDaysCount to 0 in the registry. II Every subsequent execution
1. Compare current date with lastUsed date in registry.
2. If they are different
lastUsedDate = current date;
usedDaysCount++;
3. If usedDaysCount > 10
Display nag screen and exit
Else
Get on with the program.Cheers, Vıkram.
Déjà moo - The feeling that you've seen this bull before. Join the CP group at NationStates. Password:
byalmightybob