在Windows窗体中创建系统日期问题 [英] System Date creating probliem in windows form

查看:89
本文介绍了在Windows窗体中创建系统日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作Windows窗体(.Net)的Gym管理系统.当应用程序启动时,我用当前系统日期检查一个日期(当用户注册时).如果当前日期比注册日期大1个月,那么用户将可以支付费用..但是我的问题是,如果用户更改系统日期而不是我的逻辑失败,我该怎么办?我建议我??

请确保以UTC格式检查日期/时间,以避免出现任何夏令时类型问题.
而且,当然,不要让用户容易地更改这些保存的值.

这里的风险是用户可能有正当的理由将系统时间重置为更大的时间. (但我想不起来!)


你好,

您可以拥有一个注册表项,该注册表项将在每一天之后增加.因此,即使用户更改了计算机的日期,该键也可以帮助您确定日期.此外,您还可以使用一些加密算法,避免用户手动编辑注册表项.
希望对您有帮助.

谢谢!!!!!!


在安装软件时,必须保存日期(注册软件的日期和日期到期).

因此,如果 actual_date<注册软件的日期支付费用"

这只是想法.

问候.


i am making a Gym management system in windows form ( .Net ) . when application is start i check a date ( when user is registered ) with current System date . if current date is 1 month greater than Register date then user will be able to pay fee .. but my problem is this if user change a system date than my logic is failed what i do please suggest me ??

解决方案

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.


这篇关于在Windows窗体中创建系统日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆