C# 获取Windows phone 8.1的当前区域
在获取Windows Phone 8.1(SilverLight)中的用户设置区域时,我遇到了一个问题 情况:我已将区域设置为C# 获取Windows phone 8.1的当前区域,c#,.net,windows-phone-8,windows-phone-8.1,C#,.net,Windows Phone 8,Windows Phone 8.1,在获取Windows Phone 8.1(SilverLight)中的用户设置区域时,我遇到了一个问题 情况:我已将区域设置为英国,语言设置为英语(美国)(这样做是有效的) 在这种情况下,我仍然通过以下方法获取地区UnitedState(US): RegionInfo Thread.CurrentThread System.Globalization private static void GetRegion() { // all of the three returing Unite
英国
,语言设置为英语(美国)
(这样做是有效的)
在这种情况下,我仍然通过以下方法获取地区UnitedState(US)
:
RegionInfo
Thread.CurrentThread
System.Globalization
private static void GetRegion() { // all of the three returing UnitedStates. var dfg = RegionInfo.CurrentRegion; var cuture = Thread.CurrentThread.CurrentCulture; var cul = CultureInfo.CurrentCulture; }
为什么不将英国作为一个地区返回?基于我之前的回答:
字符串区域=
Windows.System.UserProfile.GlobalizationPreferences.HomeGeographicRegion;
您可以使用前面提到的通常用于WP8或WP8.1的RegionInfo.CurrentRegion
属性
很抱歉,我忘了提到我正在WP8.1 silverlight上开发。@我知道了,循环似乎是8.1运行时中唯一一个修复了它的方法,请参阅:谢谢您的参考,但确实不能使用它。这不是一个好的解决方案:(你是如何设置区域的?设置正确吗?@xmashallax是的,我设置了。我去设置=>region=>selected UnitedKingdom-(没有更改语言)=>重新启动手机=>再次检查地区=>it UK。看看这个StackO问题/答案也许你可以在那里找到更多信息:没有帮助已经检查过了..我不想改变语言。这是有效的。我想改变国家,不需要改变语言。