I have a C# program that I would like to sell and I want to offer a 14 day trial, I understand that all piracy prevention schemes are overcome so I don't want to waste much time doing this. Could anyone offer any suggestion and even some sample code?
Thanks
If you do not want to waste time in designing a licensing scheme, consider a ready-to-use system like CryptoLicensing - it supports X day trials among other things.
DISCLAIMER: I work for LogicNP Software, the developers of CryptoLicensing.
I would use .NET Reactor over at www.eziriz.com
My choice would be to store the date of the install (encrypted with a key) in the registry or config file. Look at this each time the application starts.
You can protect your app.config file using something like the RsaProtectedConfigurationProvider .
Obviously if they decompile the source they'll find the key in it, obfuscating might help this a bit, or using public/private key but that is probably an overkill for what you need.
To get the present 'Time' in C you have to use the header file stdlib.h and the function:
Program:
Store the date of the install encryped as mentioned.
Also store todays date every time the app starts. If the day suddenly has gone back in time, you know they've cheaten and you close the program.
Just do a nag screen if it's not registered. People are going to steal your software, whether you like it or not. Wasting time on a copy protection system is just going to make it more frustrating when people steal your software.
A gentle reminder that it's still in the trial stage will probably suit you better, ala WinRar.