获取远程服务器的确切时间 [英] Get the exact time for a remote server

查看:13
本文介绍了获取远程服务器的确切时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C# 中,如何查询远程服务器的当前时间?

In C#, how do I query a remote server for its current time?

net time \servername

但返回一个包含秒的日期戳.

but returning a datestamp that includes seconds.

谢谢

推荐答案

Windows 时间服务实现 NTP.这是一个 C# NTP 实现客户.可以在 简单网络时间协议客户端 中找到使用它的 Windows GUI.由 Valer Bocan 撰写.

Windows Time Service implements NTP. Here is a C# implementation of an NTP client. A Windows GUI using it can be found at Simple Network Time Protocol Client. It's by Valer Bocan.

这篇关于获取远程服务器的确切时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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