c# 获取服务器时间

c# 获取服务器时间

ID:10212434

大小:57.00 KB

页数:15页

时间:2018-06-12

c#  获取服务器时间_第1页
c#  获取服务器时间_第2页
c#  获取服务器时间_第3页
c#  获取服务器时间_第4页
c#  获取服务器时间_第5页
资源描述:

《c# 获取服务器时间》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、C#获取服务器时间Postedon2009-12-1613:17Pagan阅读(1052)评论(0)编辑收藏 代码usingSystem;usingSystem.Net;usingSystem.Net.Sockets;namespaceSNTPTime{//Leapindicatorfieldvaluespublicenum_LeapIndicator{NoWarning,//0-NowarningLastMinute61,//1-Lastminutehas61secondsLastMinute59,//2-Lastmin

2、utehas59secondsAlarm//3-Alarmcondition(clocknotsynchronized)}//Modefieldvaluespublicenum_Mode{SymmetricActive,//1-SymmetricactiveSymmetricPassive,//2-SymmetricpasiveClient,//3-ClientServer,//4-ServerBroadcast,//5-BroadcastUnknown//0,6,7-Reserved}//Stratumfieldvalu

3、espublicenum_Stratum{Unspecified,//0-unspecifiedorunavailablePrimaryReference,//1-primaryreference(e.g.radio-clock)SecondaryReference,//2-15-secondaryreference(viaNTPorSNTP)Reserved//16-255-reserved}///

///SNTPTimeClient的摘要说明。//////Publicclassmembers://///

4、/LeapIndicator-Warnsofanimpendingleapsecondtobeinserted/deletedinthelast///minuteofthecurrentday.(Seethe_LeapIndicatorenum)//////VersionNumber-Versionnumberoftheprotocol(3or4).//////Mode-Returnsmode.(Seethe_Modeenum)//////Stratum-Stratumoftheclock.(Seethe_Stratume

5、num)//////PollInterval-Maximumintervalbetweensuccessivemessages.//////Precision-Precisionoftheclock.//////RootDelay-Roundtriptimetotheprimaryreferencesource.//////RootDispersion-Nominalerrorrelativetotheprimaryreferencesource.//////ReferenceID-Referenceidentifier(

6、eithera4characterstringoranIPaddress).//////ReferenceTimestamp-Thetimeatwhichtheclockwaslastsetorcorrected.//////OriginateTimestamp-Thetimeatwhichtherequestdepartedtheclientfortheserver.//////ReceiveTimestamp-Thetimeatwhichtherequestarrivedattheserver.//////Transm

7、itTimestamp-Thetimeatwhichthereplydepartedtheserverforclient.//////RoundTripDelay-Thetimebetweenthedepartureofrequestandarrivalofreply.//////LocalClockOffset-Theoffsetofthelocalclockrelativetotheprimaryreference///source.//////Initialize-Setsupdatastructureandprep

8、aresforconnection.//////Connect-Connectstothetimeserverandpopulatesthedatastructure.//////IsResponseValid-Returnstrueifreceiveddataisvalidandifcomesfrom

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。