Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Maybe someone steal and copy my important application some day.
And I don't want him run it with endless times.
How can let my application run only three times? What code should write in the application?
Posted
Updated 11-Jul-10 1:25am
v2

Maybe you shouldn't worry about it. Copy protection won't work because if your application is deemed to be important enough, someone somewhere will figure out a way to deactivate anything you might put in the code.

However, if you really think your application is worthy of stealing, you could:

0) Implement a counter that is actually stored in the executable.

1) Create/store a guid in the exe AND the registry each time the program is run.

As long as the counter is < 3 and the guid in the app matches the guid in the registry, you app will run.
 
Share this answer
 
Comments
eagle_chen 11-Jul-10 14:30pm    
"Creat a registry as long as the counter is <3, the app will run!"That's a good idea! Thanks!
Emilio Garavaglia 11-Jul-10 15:50pm    
Store a counter in the exe is not a good idea. The place the exe are stored may be not writable. And if I am a professional user (the only ones that can pay for a professional application) I'll not trust an exe that modify itself. The proper place is in "AppData", where a configuration file can be used for this purpose, or the registry.

Remember that - as said by the judge against Sony- "it is your software, but it is not your computer".
- Writing "Starts left..." on hard drive(encrypted key in registry.. etc) (popular, but not secure).
- Writing "Starts left..." on server(enough get CPU-ID & write one short php-script).
 
Share this answer
 
v2

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