Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,


I'm working on the trail version setup using visual studio 2008. The database is MS-Access stored locally i.e client machine.

I'm stored the expiry date in my db and registry file. And in the application load, I checked that current date (using System.DateTime.Now) is greater than expiry date. If its true, after that the application won't run in future.

Here the problem is,If the user changed the date time in his/her machine, the tool will run without affect my trail version.


how i has to resolve this one.

Where i need to store the expiry date during setup.

Note: Not using any central database here.

Regards,
Sheik
Posted

There are a lot of different ways you could tackle this problem. It all depends on how badly you want to secure your software. For instance, what you have now is good first-level protection. It stops the person who is basically honest. Your big issue really isn't that the person will change the date on their machine. So many things depend on that date (if they are part of a domain, for instance, they couldn't even log on with a computer that has a different date) that it really isn't feasible to change the system date to defeat your software. More likely they will change your registry key to make the date years in the future.

To prevent the user from changing their system date to defeat your software, simply check the Internet for the correct date. That would easily solve that problem (assuming that the clients are connected to the Internet at least intermittently).

To prevent the user from changing the value in the registry, you could encrypt the value or at least obfuscate it. For instance, if you didn't want to go to full encryption, you could make a long random string and then insert each number of your date into different positions within the string. Then, you could read only those positions of the string to get your date value back. Full encryption would be better, and it isn't that hard in C#, it's just an extra step.

If you really want to go to the next level of protection, you need to start looking into other ways of doing trials. There are a bunch of free tools and tips out there for doing so. Search Google for "30 day trial C#" and you will get all of the advice you need.

Here is another option, right from Code Project:

Application Trial Maker[^]
 
Share this answer
 
Comments
shek124 22-Jun-12 7:57am    
Thanks Tim. My 5

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