开发者

How to set Linux/Mac computer clock with C#/Mono?

开发者 https://www.devze.com 2023-01-27 02:12 出处:网络
how can I programmatically set the hardware computer clock under Linux and Mac in C# with the Mono CLR?

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:

https:开发者_开发技巧//github.com/mc-kay/sharp-timetools/


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消