如何检查系统dateTime如果已更改 [英] How to check the system dateTime If it has changed

查看:96
本文介绍了如何检查系统dateTime如果已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个程序,用于存储系统'DateTime在数据库中的更多信息..



我的问题是用户更改system'datetime时的例子返回最后一个前进两天或两天...





如何检查计算机'日期时间是否真实?

i write a program that store system'DateTime in database with more information ..

my Problem is when a user changed system'datetime for example Returns the last two days or two days go forward...


how can i check computer ' datetime is true ?

推荐答案

对于关键的现在类型数据,即数据输入日期/时间总是使用您更确定不会的服务器日期更改。
For critical Now type data i.e. data entry date/time always use the servers date which you are more certain that wouldn't be changed.


如果有一个单独的服务器并且没有真正的方法可以篡改服务器的实时时钟,那么请遵循Mehdi Gholam的建议并使用服务器的时钟。实际上这是最好的做法。



但你还没有告诉我们数据库在不同的机器上是残留的。在这种情况下,上述陈述是无用的。但是,您可以使用NTP和SNTP协议使用外部时间源来验证本地时钟( C#中的SNTP客户端 [ ^ ] )。



但是,如果你的系统是孤立的,这也不会有用。您可以实现非常复杂的方法来检测本地时间篡改,但我不知道您是否真的需要它们。
If there is a separate server and there is no real way the server's real time clock can be tampered, than follow Mehdi Gholam's advice and use the server's clock. Actually this is the best practice.

But you haven't dtold us that the database is residig on a differenct machine. In this situation the above statement is useless. You can however use external time sources using NTP and SNTP protocol, to validate local clock (SNTP Client in C#[^]).

Still, if your system is isolated, this won't work either. There are very complicated methos you could implement to detect local time tampering, but I don't know if you really need them.


这篇关于如何检查系统dateTime如果已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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