This documentation is archived and is not being maintained.

RegionInfo.DisplayName Property

Gets the full name of the country/region in the language of the localized version of .NET Framework.

[Visual Basic]
Public Overridable ReadOnly Property DisplayName As String
[C#]
public virtual string DisplayName {get;}
[C++]
public: __property virtual String* get_DisplayName();
[JScript]
public function get DisplayName() : String;

Property Value

The full name of the country/region in the language of the localized version of .NET Framework.

Remarks

For example, if the .NET Framework English version is installed, the United States is "United States". If the .NET Framework Spanish version is installed, regardless of the language that the system is set to display, the country/region name is displayed in Spanish; therefore, the United States is "Estados Unidos".

Example

[Visual Basic, C#, C++] The following code example displays the properties of the RegionInfo class.

[Visual Basic] 
Imports System
Imports System.Globalization


Public Class SamplesRegionInfo   

   Public Shared Sub Main()

      ' Displays the property values of the RegionInfo for "US".
      Dim myRI1 As New 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)

   End Sub 'Main 

End Class 'SamplesRegionInfo


'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



[C#] 
using System;
using System.Globalization;

public class SamplesRegionInfo  {

   public static void Main()  {

      // Displays the property values of the RegionInfo for "US".
      RegionInfo myRI1 = new 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

*/

[C++] 
#using <mscorlib.dll>
using namespace System;
using namespace System::Globalization;

int main()  {

   // Displays the property values of the RegionInfo for "US".
   RegionInfo* myRI1 = new RegionInfo( S"US" );
   Console::WriteLine( S"   Name:                         {0}", myRI1->Name );
   Console::WriteLine( S"   DisplayName:                  {0}", myRI1->DisplayName );
   Console::WriteLine( S"   EnglishName:                  {0}", myRI1->EnglishName );
   Console::WriteLine( S"   IsMetric:                     {0}", __box(myRI1->IsMetric));
   Console::WriteLine( S"   ThreeLetterISORegionName:     {0}", myRI1->ThreeLetterISORegionName );
   Console::WriteLine( S"   ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName );
   Console::WriteLine( S"   TwoLetterISORegionName:       {0}", myRI1->TwoLetterISORegionName );
   Console::WriteLine( S"   CurrencySymbol:               {0}", myRI1->CurrencySymbol );
   Console::WriteLine( S"   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

*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

RegionInfo Class | RegionInfo Members | System.Globalization Namespace | Name | EnglishName | TwoLetterISORegionName | ThreeLetterISORegionName | ThreeLetterWindowsRegionName

Show: