1 / 16
文档名称:

c# 获取服务器时间.docx

格式:docx   大小:37KB   页数:16页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

c# 获取服务器时间.docx

上传人:niupai21 2022/5/20 文件大小:37 KB

下载得到文件列表

c# 获取服务器时间.docx

文档介绍

文档介绍:C#获取服务器时间
Posted on 2009-12-16 13:17 Pagan 阅读(1052)评论(0)编辑收藏 田日代码
using System;
using ;
using the reply departed th e server for client.
///
/// RoundTripDelay - The time between the departure of request a nd arrival of reply.
///
/// LocalClockOffset 一 The offset of the local clock relative to the primary reference
/// source.
///
/// Initialize - Sets up data structure and prepares for connect
ion.
///
/// Connect - Connects to the time server and populates the data strueture.
///
/// IsResponseValid 一 Returns true if received data is valid and if comes from
/// a NTP-compliant time server.
///
/// ToString - Returns a string representation of the object.
///
///
/// Structure of the standard NTP header (as described in RFC 20
30)
/// 1 2 3
/// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
1
/// +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ _+_+_+_+
/// |LI | VN |Mode | Stratum | Poll | Precision
I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+
/// | Root Delay |
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+
/// | Root Dispersion |
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+
/// | Reference Identifier |
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+
/// I I
/// | Reference Timestamp (64)
I
/// I I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ _+_+_+_+
/// I I
/// I Originate Timestamp (64)
/// I I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+
/// | |
/// | Receive Timestamp (64) |
/// I I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+
_+_+_+_+
/// I I
/// | Transmit Timestamp (64)
I
/// I I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+
_+_+_+_+
/// I Key Identifier (optional) (32)
I
/// +_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+
_+_+_+_+
/// I I
/// I I
/// I Message