System.Globalization.RegionInfo Class

Contains information about the country/region.

See Also: RegionInfo Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class RegionInfo

Remarks

Unlike the System.Globalization.CultureInfo class, the System.Globalization.RegionInfo class does not represent user preferences and does not depend on the user's language or culture.

Names Associated with a RegionInfo Object

The name of a System.Globalization.RegionInfo object is one of the two-letter codes defined in ISO 3166 for country/region. Case is not significant. The RegionInfo.Name, RegionInfo.TwoLetterISORegionName, and RegionInfo.ThreeLetterISORegionName properties return the appropriate codes in uppercase. For the current list of System.Globalization.RegionInfo names, see tp://go.microsoft.com/fwlink/?LinkId=190591 on the ISO website.

Instantiating a RegionInfo Object

To instantiate a System.Globalization.RegionInfo object, you pass the RegionInfo.#ctor(string) constructor either a two-letter region name, such as "US" for the United States, or the name of a specific culture, such as "en-US" for English (United States). However, we recommend that you use a specific culture name instead of a two-letter region name, because a System.Globalization.RegionInfo object is not completely language-independent. Several System.Globalization.RegionInfo properties, including RegionInfo.DisplayName, RegionInfo.NativeName, and RegionInfo.CurrencyNativeName, depend on culture names.

The following example illustrates the difference in System.Globalization.RegionInfo property values for three objects that represent Belgium. The first is instantiated from a region name (BE) only, while the second and third are instantiated from culture names (fr-BE for French (Belgium) and and nl-BE for Dutch (Belgium), respectively). The example uses reflection to retrieve the property values of each System.Globalization.RegionInfo object.

code reference: System.Globalization.RegionInfo#2

In scenarios such as the following, use culture names instead of country/region names when you instantiate a System.Globalization.RegionInfo object:

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0