IntroductionThe CultureInfo class will provide us all Culture information available in .Net Framework. You can use CultureInfo.Get Cultures static method for getting all the culture information. To get associated specific culture, please use static method CultureInfo.CreateSpecificCulture. The following example will show you how to get all culture information. CodeSnippetstatic void Main(string[] args)
{// Get culture namesList<string> list = new List<string>();foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
{string specName = "(none)";try { specName = CultureInfo.CreateSpecificCulture(ci.Name).Name;}catch(Exception) { }
list.Add(string.Format("{0,-12}{1,-12}{2}", ci.Name, specName, ci.EnglishName));
}
list.Sort();
Console.WriteLine("CULTURE SPEC.CULTURE ENGLISH NAME");
Console.WriteLine("----------------------------------------------------");foreach (string str in list)
Console.WriteLine(str);
Console.ReadLine();
}That's all, just copy this code and reuse in your porject. i hope this is save your time. |