获取除英语以外的其他语言的国家列表

我可以使用下面的代码获取国家/地区名称列表,(从我记不起的地方复制)

我的问题是,我可以获得其他语言的国家名单,例如泰国吗?

///  /// method for generating a country list, say for populating /// a ComboBox, with country options. We return the /// values in a Generic List ///  ///  public static List GetCountryList() { //create a new Generic list to hold the country names returned List cultureList = new List(); //create an array of CultureInfo to hold all the cultures found, these include the users local cluture, and all the //cultures installed with the .Net Framework CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures); //loop through all the cultures found foreach (CultureInfo culture in cultures) { //pass the current culture's Locale ID (http://msdn.microsoft.com/en-us/library/0h88fahh.aspx) //to the RegionInfo contructor to gain access to the information for that culture RegionInfo region = new RegionInfo(culture.LCID); //make sure out generic list doesnt already //contain this country if (!(cultureList.Contains(region.EnglishName))) //not there so add the EnglishName (http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo.englishname.aspx) //value to our generic list cultureList.Add(region.EnglishName); } return cultureList; } 

http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo.displayname.aspx

DisplayName属性以.NET Framework的本地化版本的语言显示国家/地区名称。 例如,DisplayName属性在英文版的.NET Framework上以英语显示国家/地区, 在西class牙语版本的.NET Framework上以西class牙语显示

因此,看起来.NET Framework中的每种语言都没有国家/地区名称列表,只有安装的.NET Framework所使用的语言。

使用DisplayName (在当前Framework NativeName为您提供名称)或NativeName (在本机文化中为您提供名称)而不是EnglishName

很晚的回答:

在我的应用程序中,用户可以选择一种语言(在应用程序支持的语言中),在UI中我需要以所选语言显示国家/地区名称。

我发现NuGet包IsoNames满足了这个目的。 它提供了方法

 IsoNames.CountryNames.GetName(CultureInfo culture, string countrycode); 

从而克服了DisplayName隐含的限制。