开发者

Alternatives to checking against the system time

开发者 https://www.devze.com 2023-01-02 18:23 出处:网络
I have an application which license should expire after some period of time. I can check the time in the applicatino against the system time, but system time 开发者_如何学JAVAcan be changed by the ad

I have an application which license should expire after some period of time.

I can check the time in the applicatino against the system time, but system time 开发者_如何学JAVAcan be changed by the administrator, therefore it's not a good idea to check against the system time in my opinion.

What alternatives do I have?

Thank you


You could check against an online NTP server or, alternatively, at every run, note how many days have elapsed on the system clock. If they ever set this back before the time you know has currently elapsed, it will be obvious and you will know they are trying to cheat.


I'd say that forcing the user to run with the wrong date set would be enough deterent for most people. However, you could always combine it by storing the last run date in the registry and every time you compare that with today's date, if the the last run date is higher than today's date they've probably reset the date. There could be legit reasons for this though so you might want to have a check that you only disable the software after this has been done x number of times or similar.


you can use a counter so the user can use the software n times

anotherway is that you store the start- and enddate of the user starting the application. If the user starts the application another time, you check against it.

Another way is to always check with an online server.

0

精彩评论

暂无评论...
验证码 换一张
取 消