How to CultureInfo in C#

The CultureInfo class holds culture-specific information, such as the associated language, sublanguage, country/region, calendar, and cultural conventions. This class also provides access to culture-specific instances of DateTimeFormatInfo, NumberFormatInfo, CompareInfo, and TextInfo.

Culture information sample:

The cultures are generally grouped into three sets: the invariant culture, the neutral cultures, and the specific cultures. The cultures have a hierarchy, such that the parent of a specific culture is a neutral culture and the parent of a neutral culture is the InvariantCulture. The Parent property returns the neutral culture associated with a specific culture. If the resources for the specific culture are not available in the system, the resources for the neutral culture are used; if the resources for the neutral culture are not available, the resources embedded in the main assembly are used.

The culture is a property of the executing thread. This read-only property returns Thread.CurrentCulture. You can find the current culture information from.

The following C# program shows how to get all culture names in the .NET Framework. To use CultureInfo class you need to include System.Globalization namespace in your project.

using System;
using System.Threading;
using System.Globalization;
using System.Windows.Forms;

namespace WindowsFormsApplication1
	public partial class Form1 : Form
		public Form1()

		private void button1_Click(object sender, EventArgs e)
			foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
				MessageBox.Show(ci.EnglishName+ " - " + ci.Name);
} (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About