【发布时间】:2015-04-27 10:41:05
【问题描述】:
我对 CurrentCulture(C#、Windows 应用商店应用)有疑问。
我需要获取用户国家代码(将默认国家设置为我的国家列表视图)。
我用过代码:
string currentCountryCode = CultureInfo.CurrentCulture.Name;
if (currentCountryCode != null && currentCountryCode.Length == 5)
{
currentCountryCode = currentCountryCode.ToLower().Substring(3);
}
我的问题是:为什么我得到错误的国家代码(我得到“我们”,但我的计算机区域设置中有拉脱维亚)?
【问题讨论】:
-
您使用什么服务来获取国家代码和标志?
标签: c# windows-store-apps cultureinfo