Implementing Expiration Dates in an application?

后端 未结 7 1184
轻奢々
轻奢々 2021-01-21 08:25

I\'d like to put an expiration date in some software I made. Obviously

psuedocode:

if time() > xxx: exit()

All someone has to do he

7条回答
  •  执念已碎
    2021-01-21 09:11

    Someone will always be able to defeat your system if they put enough effort into it. Joel Spolsky said something to this effect that is very accurate (words are mine):

    Your software protection scheme does not have to be bullet-proof (nor can it be), it just needs to be good enough to keep the honest people honest

    So, with that in mind we can think up something clever enough to keep the honest people honest as the filthy cheaters are not going to pay for your app anyway. I have never needed to do this, nor have I looked into any known methods, but I can think of a few ideas:

    1. Use a two-way hash to store the initial date and compare that to the present date. You can save the has to disk.

    2. On Windows, use the registry. Yes, this is no where near bullet-proof, but most people will not go digging through the registry to find your key (and most will not know how to anyway).

    3. Use the created date of your installation files as a reference.

提交回复
热议问题