如何更新日期和时间控制面板以匹配 W32Time 服务配置?

编程入门 行业动态 更新时间:2024-10-22 07:27:03
本文介绍了如何更新日期和时间控制面板以匹配 W32Time 服务配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个客户端/服务器应用程序,它有利于让客户端和服务器上的 PC 时钟同步.我希望我的安装程序提供一个选项来自动配置 W32Time 服务.

I have a client/server application for which it is beneficial to have the PC clocks on the client and server synchronized. I want my setup program to offer an option to configure the W32Time service automatically.

我找到了足够的文档来配置服务的注册表项(主要是 此处),并且我已确认在重新启动服务后,我的测试客户端 PC 上的时钟已更正以匹配我的测试服务器 PC 上的时钟.但是,如果我查看客户端 PC 上的日期和时间控制面板,它仍然表明时钟设置为同步到 time.windows(默认)而不是测试服务器 PC.

I have found sufficient documentation to configure the service's registry entries (principally here), and I have confirmed that after restarting the service, the clock on my test client PC is corrected to match the clock on my test server PC. However, if I look at the Date and Time control panel on the client PC, it still indicates that the clock is set to be synchronized to time.windows (the default) instead of the test server PC.

如何触发日期和时间控制面板来更新自身以匹配时间服务配置?或者失败了,我在哪里可以找到控制面板的配置存储并自行更新?

How can I trigger the Date and Time control panel to update itself to match the time service configuration? Or failing that, where can I find the control panel's configuration stash and update it myself?

推荐答案

在注册表中挖掘,我找到了答案.日期和时间控制面板在其自己的注册表位置存储时间服务器列表:

Digging around in the registry, I have found an answer. The Date and Time control panel stores a list of time servers under its own registry location:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers

无论 W32Time 的实际配置如何,控制面板在显示其 UI 时都会使用此信息.键下的每个值都有一个数字名称,并且属于包含时间服务器主机名的 REG_SZ 类型.(默认)值是当前在控制面板中选择的服务器的编号.

Regardless of the actual configuration of W32Time, the control panel will use this information when showing its UI. Each value under the key has a numeric name and is of type REG_SZ containing the hostname of a time server. The (Default) value is the number of the currently-selected server in the control panel.

因此,我需要为我的时间服务器添加一个新的字符串值并将其编号设置为(默认)值.

Therefore, I needed to add a new string value for my time server and set its number in the (Default) value.

这篇关于如何更新日期和时间控制面板以匹配 W32Time 服务配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 12:42:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1393577.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:面板   日期   时间   W32Time

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!