Tag: unity3d 5

TimeZoneInfo.FindSystemTimeZoneById()在Unity应用程序中抛出exception

如果我在C#控制台应用程序中执行此代码,它可以正常工作。 TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById(“Eastern Standard Time”); Console.WriteLine(easternZone.DisplayName); 但是,当我在Unity应用程序中使用相同的方法时,会抛出exception: System.TimeZoneNotFoundException: Exception of type ‘System.TimeZoneNotFoundException’ was thrown. at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) [0x00000] in :0 at System.TimeZoneInfo.FindSystemTimeZoneById (System.String id) [0x00000] in :0 … 我注意到一个奇怪的事情是,当MSDN文档明确表示从注册表中检索信息时,会在名为“FindSystemTimeZoneByFileName”的方法中抛出exception。