开发者

setting the system time with C#.NET without using kernel32.dll

开发者 https://www.devze.com 2023-02-11 15:00 出处:网络
Is there a way to set the system time in C#.NET without using kernel32.dll? I\'m on a 64 bit system and calling the set time function seems to return \"false\" f开发者_C百科or me.The .NET framework d

Is there a way to set the system time in C#.NET without using kernel32.dll?

I'm on a 64 bit system and calling the set time function seems to return "false" f开发者_C百科or me.


The .NET framework does not generally concern itself with low level system management concerns of this nature.

The problem here is that you cannot ask a question like this without telling us why it matters to you, so that people can properly contextualise an answer for you without having to be psychic.

Why do you need to do this? Will it be quicker? Are you worried the DLL might not be on the system :D

One way of finding out is to use Reflector (get it while it's hot) to look for the kernel32 method name- chances are whatever is wrapping it will be using P/Invoke and, unless they're paying silly buggers will just use the same name for the wrapper stub.


Try to Run as administrator or disable UAC -if any-

0

精彩评论

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

关注公众号