jjzjj

TimeZoneInformation

全部标签

.net - HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\TimeZoneKeyName 已损坏?

我正在尝试确定Windows系统的当前时区。以下代码片段(松散地)基于@MattJohnson在此线程上的回答:GettinglocaltimezoneidentifierwhenOSdisplaylanguageisnon-englishusing(RegistryKeyregistryKey=Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\TimeZoneInformation")){if(registryKey!=null){stringwindowsTimeZoneId=registryKe