如何使用 C#/Mono 设置 Linux/Mac 计算机时钟?
如何使用 Mono CLR 在 C# 中以编程方式在 Linux 和 Mac 下设置硬件计算机时钟?
编辑:
我创建了一个 C# 库来执行此操作,因此如果其他人需要此功能,请在此处获取它:
how can I programmatically set the hardware computer clock under Linux and Mac in C# with the Mono CLR?
EDIT:
I created a C# library to do this, so if everyone else need this function, grab it here:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要使用 PInvoke(文档:http://www.mono-project.com/Interop_with_Native_Libraries) 用于此的本机 (c/c++) 函数。对于 Linux,本机函数/结构列于此处:如何在 Linux 上以编程方式设置硬件时钟吗?
You will need to use PInvoke (documentation : http://www.mono-project.com/Interop_with_Native_Libraries) the native (c/c++) functions for this. For linux the native function / struct is listed here : How Do You Programmatically Set the Hardware Clock on Linux?