CultureInfo.DisplayName-Eigenschaft
Ruft den Kulturnamen im Format "<VollständigeSprache> (<VollständigesLand/Region>)" in der Sprache der lokalisierten Version von .NET Framework ab.
Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Overridable ReadOnly Property DisplayName As String
'Usage
Dim instance As CultureInfo
Dim value As String
value = instance.DisplayName
public virtual string DisplayName { get; }
public:
virtual property String^ DisplayName {
String^ get ();
}
/** @property */
public String get_DisplayName ()
public function get DisplayName () : String
Eigenschaftenwert
Der Kulturname im Format "<VollständigeSprache> (<VollständigesLand/Region>)" in der Sprache der lokalisierten Version von .NET Framework, wobei <VollständigeSprache> der vollständige Name der Sprache ist und <VollständigesLand/Region> der vollständige Name des Landes bzw. der Region.
Hinweise
Wenn beispielsweise die englische Version von .NET Framework installiert ist, gibt die DisplayName-Eigenschaft für die Kultur "en-US (United States)" den Wert "English (United States)" zurück. Wenn die spanische Version von .NET Framework installiert ist, wird der Kulturname unabhängig von der für das System festgelegten Anzeigesprache auf Spanisch angezeigt. Die DisplayName-Eigenschaft für die Kultur "en-US" gibt daher "Inglés (Estados Unidos)" zurück.
Beim Erstellen einer benutzerdefinierten Kultur mithilfe der CultureAndRegionInfoBuilder-Klasse wird die DisplayName-Eigenschaft mit dem Wert der NativeName-Eigenschaft initialisiert.
Beispiel
Im folgenden Codebeispiel werden mehrere Eigenschaften der neutralen Kulturen angezeigt.
Imports System
Imports System.Globalization
Public Class SamplesCultureInfo
Public Shared Sub Main()
' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci
End Sub 'Main
End Class 'SamplesCultureInfo
'This code produces the following output. This output has been cropped for brevity.
'
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
'ar ar ara ARA Arabic Arabic
'bg bg bul BGR Bulgarian Bulgarian
'ca ca cat CAT Catalan Catalan
'zh-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
'zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
'cs cs ces CSY Czech Czech
'da da dan DAN Danish Danish
'de de deu DEU German German
'el el ell ELL Greek Greek
'en en eng ENU English English
'es es spa ESP Spanish Spanish
'fi fi fin FIN Finnish Finnish
using System;
using System.Globalization;
public class SamplesCultureInfo {
public static void Main() {
// Displays several properties of the neutral cultures.
Console.WriteLine( "CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME" );
foreach ( CultureInfo ci in CultureInfo.GetCultures( CultureTypes.NeutralCultures ) ) {
Console.Write( "{0,-7}", ci.Name );
Console.Write( " {0,-3}", ci.TwoLetterISOLanguageName );
Console.Write( " {0,-3}", ci.ThreeLetterISOLanguageName );
Console.Write( " {0,-3}", ci.ThreeLetterWindowsLanguageName );
Console.Write( " {0,-40}", ci.DisplayName );
Console.WriteLine( " {0,-40}", ci.EnglishName );
}
}
}
/*
This code produces the following output. This output has been cropped for brevity.
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
ar ar ara ARA Arabic Arabic
bg bg bul BGR Bulgarian Bulgarian
ca ca cat CAT Catalan Catalan
zh-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
cs cs ces CSY Czech Czech
da da dan DAN Danish Danish
de de deu DEU German German
el el ell ELL Greek Greek
en en eng ENU English English
es es spa ESP Spanish Spanish
fi fi fin FIN Finnish Finnish
*/
using namespace System;
using namespace System::Globalization;
int main()
{
// Displays several properties of the neutral cultures.
Console::WriteLine( "CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME" );
System::Collections::IEnumerator^ enum0 = CultureInfo::GetCultures( CultureTypes::NeutralCultures )->GetEnumerator();
while ( enum0->MoveNext() )
{
CultureInfo^ ci = safe_cast<CultureInfo^>(enum0->Current);
Console::Write( "{0,-7}", ci->Name );
Console::Write( " {0,-3}", ci->TwoLetterISOLanguageName );
Console::Write( " {0,-3}", ci->ThreeLetterISOLanguageName );
Console::Write( " {0,-3}", ci->ThreeLetterWindowsLanguageName );
Console::Write( " {0,-40}", ci->DisplayName );
Console::WriteLine( " {0,-40}", ci->EnglishName );
}
}
/*
This code produces the following output. This output has been cropped for brevity.
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
ar ar ara ARA Arabic Arabic
bg bg bul BGR Bulgarian Bulgarian
ca ca cat CAT Catalan Catalan
zh-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
cs cs ces CSY Czech Czech
da da dan DAN Danish Danish
de de deu DEU German German
el el ell ELL Greek Greek
en en eng ENU English English
es es spa ESP Spanish Spanish
fi fi fin FIN Finnish Finnish
*/
import System.* ;
import System.Globalization.* ;
public class SamplesCultureInfo
{
public static void main(String[] args)
{
// Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME "
+ " ENGLISHNAME");
for (int iCtr = 0;
iCtr < (CultureInfo.GetCultures(CultureTypes.NeutralCultures).
length); iCtr++) {
CultureInfo ci =
CultureInfo.GetCultures(CultureTypes.NeutralCultures)[iCtr];
Console.Write("{0,-7}", ci.get_Name());
Console.Write(" {0,-3}", ci.get_TwoLetterISOLanguageName());
Console.Write(" {0,-3}", ci.get_ThreeLetterISOLanguageName());
Console.Write(" {0,-3}", ci.get_ThreeLetterWindowsLanguageName());
Console.Write(" {0,-40}", ci.get_DisplayName());
Console.WriteLine(" {0,-40}", ci.get_EnglishName());
}
} //main
} //SamplesCultureInfo
/*
This code produces the following output. This output has been cropped
for brevity.
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
ar ar ara ARA Arabic Arabic
bg bg bul BGR Bulgarian Bulgarian
ca ca cat CAT Catalan Catalan
zh-CHS zh zho CHS Chinese (Simplified) Chinese
(Simplified)
zh-CHT zh zho CHT Chinese (Traditional) Chinese
(Traditional)
cs cs ces CSY Czech Czech
da da dan DAN Danish Danish
de de deu DEU German German
el el ell ELL Greek Greek
en en eng ENU English English
es es spa ESP Spanish Spanish
fi fi fin FIN Finnish Finnish
*/
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
CultureInfo-Klasse
CultureInfo-Member
System.Globalization-Namespace
Name
NativeName
EnglishName
TwoLetterISOLanguageName
ThreeLetterISOLanguageName
ThreeLetterWindowsLanguageName