获得在C#中的实际日期时间,而不是系统日期时间 [英] get ACTUAL date time and not system date time in C#

查看:214
本文介绍了获得在C#中的实际日期时间,而不是系统日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我建立应该在特定的时期内,访问应用程序的一部分。

A part of the application that I am building should be accessed only during a particular time period.

我知道我们可以在C#中使用的DateTime 的属性得到当前系统时间。如果我使用的DateTime 属性则用户可以更改其系统时间和访问应用程序的一部分,当过他们想要的。

I know we can get the current system time using the properties of DateTime in C#. If I use DateTime properties then the users can change their system time and access the part of application when ever they want.

请让我知道如何在C#中当前的实际时间。

Please let me know how to get the ACTUAL current time in C#.

推荐答案

您可以查询 NTP服务器。 。NTP服务器为您提供当前时间,并允许您非常准确(这是计算机如何同步时钟)

You can query an NTP server. NTP servers provide you with the current time, and allowing you to be very accurate (that's how computers synchronize clocks).

查看示例的here

这篇关于获得在C#中的实际日期时间,而不是系统日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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