Can any one please help in populating the list of country names, its respective two letter code and three letter codes.. I tried the below snippet, but its giving me incomplete results.
static void Main(string[] args)
{
List<string> list = new List<string>();
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures))
{
try
{
RegionInfo myRI1 = new RegionInfo(ci.LCID);
list.Add(String.Format("{0,-12}{1,-12}{2}", myRI1.TwoLetterISORegionName, myRI1.EnglishName, myRI1.ThreeLetterISORegionName));
}
catch { }
}
list.Sort(); // sort by name
// write to console
foreach (string str in list)
Console.WriteLine(str);
Console.WriteLine("Total Countries" + list.Count.ToString());
Console.ReadKey();
}
}