当我使用以下代码(之前可以正常运行)时,在.NET 4.6中,我现在得到了一个不包括纳米比亚并且包括了约50次阿尔及利亚的名单。有什么想法为什么会这样或者是什么发生了变化?
private void SetCountriesComboBox()
{
RegionInfo country = new RegionInfo(new CultureInfo("en-US", false).LCID);
List countryNames = new List();
foreach (CultureInfo cul in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
country = new RegionInfo(new CultureInfo(cul.Name, false).LCID);
countryNames.Add(country.DisplayName.ToString());
}
IEnumerable nameAdded = countryNames.OrderBy(names => names).Distinct();
foreach (string item in nameAdded)
{
comboBox1.Items.Add(item);
}
}