Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
I made a c# program with an expiration date (100 days after the program is installed)
the code is:

DateTime today = DateTime.Today;
DateTime Expiration = today.AddDays(100)
;

but if the user who bought my program changed his computer's date to a previous time ... the license will be valid forever
Do you have any suggestions to solve this problem???
thanks,
Posted
Updated 19-Sep-11 10:45am
v2

Save the date every time the program is run. Then you can check the date it was last run against today's date. If today's date is equal to/earlier than the last date run, don't let the software run.

How you implement something like that is up to you.
 
Share this answer
 
v2
Comments
George_Rasmi 19-Sep-11 19:20pm    
nice idea :)
thanks John
You can also check the time on the web.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900