RegionInfo::Name Property
Gets the name or ISO 3166 two-letter country/region code for the current RegionInfo object.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System::StringThe value specified by the name parameter of the RegionInfo::RegionInfo(String) constructor. The return value is in uppercase.
-or-
The two-letter code defined in ISO 3166 for the country/region specified by the culture parameter of the RegionInfo::RegionInfo(Int32) constructor. The return value is in uppercase.
If the current RegionInfo object is created with the RegionInfo::RegionInfo(Int32) constructor that takes a culture identifier parameter, the Name property value is one of the two-letter codes defined in ISO 3166 for the country/region and is formatted in uppercase. For example, the two-letter code for the United States is "US".
If the current RegionInfo object is created with the RegionInfo::RegionInfo(String) constructor that takes a full culture name such as "en-US", the Name property value is a full culture name and not just the region name.
The predefined RegionInfo names are listed in the RegionInfo class topic. The application should use the DisplayName or EnglishName property to get the full name of the country/region.
The following code example displays the properties of the RegionInfo class.
using namespace System; using namespace System::Globalization; int main() { // Displays the property values of the RegionInfo for "US". RegionInfo^ myRI1 = gcnew RegionInfo( "US" ); Console::WriteLine( " Name: {0}", myRI1->Name ); Console::WriteLine( " DisplayName: {0}", myRI1->DisplayName ); Console::WriteLine( " EnglishName: {0}", myRI1->EnglishName ); Console::WriteLine( " IsMetric: {0}", myRI1->IsMetric ); Console::WriteLine( " ThreeLetterISORegionName: {0}", myRI1->ThreeLetterISORegionName ); Console::WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName ); Console::WriteLine( " TwoLetterISORegionName: {0}", myRI1->TwoLetterISORegionName ); Console::WriteLine( " CurrencySymbol: {0}", myRI1->CurrencySymbol ); Console::WriteLine( " ISOCurrencySymbol: {0}", myRI1->ISOCurrencySymbol ); } /* This code produces the following output. Name: US DisplayName: United States EnglishName: United States IsMetric: False ThreeLetterISORegionName: USA ThreeLetterWindowsRegionName: USA TwoLetterISORegionName: US CurrencySymbol: $ ISOCurrencySymbol: USD */
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.