Click here to Skip to main content
15,885,877 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I made a desktop application using C#.

I face an issue: I can't protect this desktop application. I do it from another client using it.

So I ask about the way in which I can do to it prevent another person from using it.

So what can I do to protect my app?

How can I give the client 30 days as trial, after that, if they do not pay, stop it.
Can you tell me how to do that?

What I have tried:

Some developers store data on registry.
Is this the best solution for that - store on registry or something else?

If user changes date time of Windows, how to handle that?

Can I prevent user from installing my app again?

Can anyone help me by answering this question with more details. Thanks!

If there is free or source code or library that I can use without paying, then I prefer that.
Posted
Updated 26-Feb-22 5:48am
v2

1 solution

That's complicated: there are major companies that try to do this and spend huge amounts of money only to find that a "cracked" version becomes available on the same day they release a new version of the software (Photoshop is a good example)

Pretty much the only way to do it would be to assemble a "fingerprint" of a system (by getting it's various component ID's and serial numbers where possible, converting that to a hashed form and storign that on an internet server with it's expiry date.
When you app starts, it generates the hash value from eth current config, and checks with your server to see if it is permitted to run.

It's not foolproof: VMs, Sandboxes and so forth can defeat it, the code can be hacked to remove the checking, and so on - and it can seriously annoy legitimate users if it "breaks" for any reason (like a minor hardware change).

Unless you are planning on shipping lots of units and there is serious money involved it's probably not a good investment of your time to add this.

A much simpler one is just to store a local value which is the expiry date of the software and check it on start up. Uninstall doesn't remove it so reinstalling won't do anything useful, but it is pretty easy to defeat even for low-tech users.

Google will show you how to do these: time limit my software C# - Google Search[^] but it's very easy to spend more money (in terms of time) than you protect, and just end up alienating genuine customers - so think carefully about how much value you ar eactually protecting before you get too far down this rabbit hole.
 
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