且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Windows窗体中创建系统日期问题

更新时间:2023-12-06 11:19:46

I think Christian''s solution is close, but his solution doesn''t detect if the user resets the date to some time between the registration date and the expiration date. (Assuming I completely understand his.)

So, I''d save another date/time ("last used") every once-in-awhile and complain if the current system time is ever more than a reasonable amount (a couple of hours?) before the "last used" time.
Be sure to do the checking of the date/time as UTC to avoid any Daylight Savings Time type issues.
And, of course, don''t make it easy for the user to change these saved values.

The risk here is that users may have a legitimate reason to reset the system time back by the larger amount. (But I can''t think of any!)


Hello,

You can have a registry key which will increment after every day''s. SO even if user changes computer''s date, this key help you to identify the days. And also you can have some encryption algorithms which will avoid user to manually edit the registry key.
Hope this will help you.

Thanks!!!!!!


When you install your software you must save the dates (the date for registered software & date expiration).

So you can ask if date is superior to date expiration "pay fee" if actual_date < date of registered software "pay fee"

This is only and idea.

Regards.