|
-
Sep 18th, 2007, 10:36 PM
#1
Thread Starter
New Member
Creating a "trial" win form
Hi, this is my first post, please bear with me If I've made any mistake.
I'm currenly creating a win form with c sharp (1.1). I was wondering how can I make a "trial" version so that the program can only be used for, let's say, 30 days after installation.
I was thinking of using the datetime object to record the installation date, but then what if the client change the system date after the installation? I noticed that those trial software we got from the internet will indeed stop functioning after certain amount of days, regardless of how we modify our system date. I wonder how they did it ?
I've been googling for this but couldn't find any solution. Please clue me on this. Thanks...
-
Sep 18th, 2007, 10:42 PM
#2
Re: Creating a "trial" win form
You need to store the date somewhere when the software is installed or first run. You then read that date and compare it to the current date each time the app is run. The trick is to hide the data well enough that it is not likely to be tampered with. You also need to safeguard against the user turning their clock back. I would suggest purchasing a licensing component if you intend to do this regularly. There are numerous cheap options available. I've previously used Quick License Manager, which was fine, and currently use Infralution Licensing System, which is .NET-based.
-
Sep 18th, 2007, 11:29 PM
#3
Thread Starter
New Member
Re: Creating a "trial" win form
Thanks for your help. Purchasing a component maybe be my last option. I figure that I could make my program "usage limited" (how many times they can execute the program) rather than "time limited". That would be rather easy.
Right now I'm curious on how they achieve "time limitation" of a software. I think the difficult part is to know when the client modify their system clock. We will have to get the date before and after the changes to keep the evaluation period right. I did some searchs and found this event:
Code:
public static event EventHandler TimeChanged
It was decribed in MSDN that this event occurs when users change the system time. I will try to create a time-based evaluation program and share my findings here. Thanks again.
-
Sep 19th, 2007, 01:15 PM
#4
Re: Creating a "trial" win form
Alternatively, store the date when the application closes, and compare that against the system clock the next time it launches...
-
Sep 19th, 2007, 06:28 PM
#5
Re: Creating a "trial" win form
You really have to do both what was suggested in posts #3 and #4 to be thorough, because the clock could be changed while your app is running or while it's not.
-
Sep 19th, 2007, 09:52 PM
#6
Re: Creating a "trial" win form
Or.. if your application is definitely going to be used on a PC with an internet connection.. you could store the information on a web server, and check it before loading. You could have "trial accounts" for users, who have to login each time they run the trial version of your software.
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|