如何获得真实的系统日期 [英] How to get the real system date
问题描述
如果用户伪造日期,我如何获得真实的系统日期/时间?
示例通过设置系统日期。
-
Mike
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.
--
Mike
推荐答案
DateTime.Now是实时,真实至少对于本地计算机来说。
您可以在互联网上查看时间服务器;我不知道现在是否有任何问题但是我打赌美国的几家机构免费提供这项服务;和
如果返回的时间与您更改它的当地时间不同。
请注意,远程时间总会有一个小的增量
服务器发送时间,直到你在你的应用程序中处理它。
你需要从win API P / Invoke SetSystemTime
-
-
Ignacio Machin,
ignacio.machin at dot.state.fl.us
Florida Department of Transportation
" Mike9900" <弥****** @ discussions.microsoft.com>在留言中写道
新闻:D0 ********************************** @ microsof t.com ...
Hi,
DateTime.Now is the REAL time, real at least for the local computer.
You can check a time server in the internet ; I don''t know if any right now
but I bet that a couple of US institutions give this service for free; and
if the returned time is different thatn the local time you change it.
Note that there will always be a little delta from the time the remote
server sent the time until you process it in your app.
You need to P/Invoke SetSystemTime from the win API
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
如果用户伪造日期,我怎样才能获得真实的系统日期/时间,例如通过设置系统日期来回答。
-
Mike
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.
--
Mike
" Mike9900" <弥****** @ discussions.microsoft.com>在留言中写道
新闻:D0 ********************************** @ microsof t.com ...
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
如果用户伪造日期,我怎样才能获得真实的系统日期/时间,例如通过设置系统日期来回答。
-
Mike
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.
--
Mike
您必须从另一台可以接受的计算机上获取日期和时间
正确的时间。这可以是服务器,数据库服务器或
NIST服务器。由于我编写的应用程序连接到数据库服务器,因此通过存储的
过程获取服务器的日期和时间是一件微不足道的事情。如果您提供有关该应用程序的更多详细信息以及您想要实现的目标,那么您可能会得到更好的答案。
SP
You have to get the date and time from another computer that you can accept
as having the correct time. This could be a server, a database server or the
NIST server. As the applications I write connect to a database server it is
a trivial matter to get the date and time of the server via a stored
procedure. If you give more details about the application and what you are
trying to achieve then you might get a better answer .
SP
日期/时间取自实时时钟(RTC),如果用户伪造
系统日期,他有效地伪造了RTC。
威利。
" Mike9900" <弥****** @ discussions.microsoft.com>在留言中写道
新闻:D0 ********************************** @ microsof t.com ...
|如果用户伪造日期,我怎样才能获得真实的系统日期/时间?
|例如,通过设置系统日期。
|
|
| -
|迈克
The date/time is taken from the real-time clock (RTC), if the user fakes the
system date, he effectively fakes the RTC.
Willy.
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
| How can I get the real system date/time if the user fakes the date, for
| example by setting the system date back.
|
|
| --
| Mike
这篇关于如何获得真实的系统日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!