Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi frnds!!!


i create application in c#.net now, i implement trial version security for limiting period, so i check system date while application is start but, problem is that when user change date then application is start.

so, please help with appropriate solution....!!
Posted

1 solution

Hi,

You can solve your issue with several ways, Let me explain one of them.

You can encrypt your key information in either Registry or some other location. First you need to store your date of expiration of your application and secondly you need to store last accessed date of your application.

Each time application starts you need to check if last accessed date is less then current date if so then prompt your license expiration ? if everything is fine then just update last accessed date.

That will work for you,
Thanks
-Amit Gajjar
 
Share this answer
 
Comments
[no name] 22-Aug-12 1:41am    
k, thx i think it works......:)
AmitGajjar 22-Aug-12 1:43am    
sure. and your always welcome.
Sergey Alexandrovich Kryukov 22-Aug-12 1:43am    
Should work, a 5.
--SA
AmitGajjar 22-Aug-12 1:44am    
Thank you SA.
adrian@csdev 21-Mar-13 19:42pm    
But theres still a hitch coz the client might take the date of the pc and change it one day back, My suggestion would be to create a count variable as integer and at the application's startup events, if its first run then set count = (Days Left), The days left have to be from installed date + 10,20,30 etc. depending on when the expiration date is, or say something like this

Label1.Text = Date.Today
Label2.Text = "2013/03/25"
Dim expDate As Date
expDate = Label2.Text
Dim installedDate As Date
installedDate = Label1.Text

Dim s As TimeSpan
s = expDate.Subtract(installedDate)
and then store variable s (encrypted in the registry and each time the app runs it will get s and subtract 1 until it's 0 , by that time it will prompt the user to by the app

Also bare in mind that when the application is removed the registry key with variable s will not be removed so users cannot bypass the rules by uninstalling and reinstalling the app

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