By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,117 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,117 IT Pros & Developers. It's quick & easy.

Best way to check for trial expiration

P: n/a
Does anyone have solid code for setting up a 30 day experiation timer
on your software.

-Peter

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
pe***@mclinn.com wrote in news:1103315019.972162.49750
@z14g2000cwz.googlegroups.com:
Does anyone have solid code for setting up a 30 day experiation timer
on your software.


Check out ActiveLock 2.0:

http://activelock.sourceforge.net/

Best part - it's free!

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2

P: n/a
I can't give away code because it's for a commercial client however I
recently did a system that uses a LicenseProvider derived object to enable a
class to run within a 30 day limit.

I used a specially coded string such as:

"This is my uncrackable code string for Friday December 17 2004"

In fact the string has a bunch of stuff in it that is encrypted in the
application and used for licensing my code but you get the picture. I use
this string to create a hash-key using MD5 encryption which I store in a
config file.. I also store the install date in plain text in the config file
local to the app.

In the LicenseProvider I reconstruct my string from details I know, add the
stored date to the end and then create an MD5 hash with it. If it's the same
as the stored hash I know that the licensing rules I chose were valid *and*
that the install date is also valid. If the user attempts to extend the demo
period by altering the date the hash key is different and the licensing
fails anyway.

If my licensing succeeds, ie if I have the right install date, I can then
decide whether this code times out after 30 days and refuse to return a
valid license if it does.

I think it's very important that you obfuscate your object with a good
obfuscator that encrypts strings. I use Xenocode becase it will also crash
IL disassemblers. This hides the internal information I use to decide my
licensing policy.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

<pe***@mclinn.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Does anyone have solid code for setting up a 30 day experiation timer
on your software.

-Peter

Nov 21 '05 #3

P: n/a
Nak
Hi Peter,
Does anyone have solid code for setting up a 30 day experiation timer
on your software.


Before committing yourself to making trialware you might want to
consider making a restricted demo instead. This can be achieved using
pre-compile directives, i.e.

#IF (Not DEMOVERSION)
Do full version stuff, this code will not be in the
demo version, it does not get compiled
#ELSE
Display error message and information on upgrading,
this code will not be in the full version, it does not get
compiled.
#END IF

The reason I say this is because you would then end up with 2 versions
of your application, a full version and a demo version, the demo version
would be impossible to change into the full version as the full version code
wouldn't even be compiled into the executable.

If you were to do as Bob Powell suggests you would have to hard code the
expiration date into the application, thus the timer would not start when
the application is first installed. This *may* be an issue to you depending
on how your distributing your application.

If you choose to make a demo and full version you can then implement a
license provider to protect your full version, if no license is available
refuse to run. This makes the licensing fiasco much easier to deal with
than attempting to hide installation dates around the users system which
will always be found.

My personal opinion is that if .NET code is so easily decompiled, you
may as well make that the *only* way a hacker is going to get it working,
make them resort to diving around in thousands of lines of code. I've
implemented licensing in this way and believe it to be most effective, I'm
not distributing "nagware" to the public, which I find highly irritating.

Anyway, just my 2 pence worth.

Nick.
Nov 21 '05 #4

P: n/a
www.aspose.net

it is free

--
Bob Hollness

-------------------------------------
I'll have a B please Bob

<pe***@mclinn.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Does anyone have solid code for setting up a 30 day experiation timer
on your software.

-Peter

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.