Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

How to make licence file for one year in c# .net?

Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer
Posted

 
Share this answer
 
Easiest way;
1) Find yourself 16 length password string which is hardcoded in ur app.

2) Use Rjndael of .net to create ur encrypt decrypt functions.

3) Create a file with any extension and write expiration date string(which is encrypted first with ur password) into it.

4) Program loads this file, if decryption succeeds it creates a copy of file under appdata folder.

5) Each time app starts, first check if this file exists; if exists decrypt it, convert to datetime and compare with datetime.now, if expired license over else show full version.
And don't forget to obfustucate your assembly.

Notes:
And keep in mind, this license file is not machine specific and works for all. if you want to create license file specific to machine, you need to create unique license files per machine with using fingerprint of it.
 
Share this answer
 

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