CultureInfo.Name Eigenschaft

Definition

Ruft den Kulturnamen im Format languagecode2-country/regioncode2ab.Gets the culture name in the format languagecode2-country/regioncode2.

public:
 virtual property System::String ^ Name { System::String ^ get(); };
public virtual string Name { get; }
member this.Name : string
Public Overridable ReadOnly Property Name As String

Eigenschaftswert

String

Der Kultur Name im Format languagecode2 - Country/regioncode2, wenn der aktuelle CultureInfo Kultur abhängig ist, oder eine leere Zeichenfolge, wenn es sich um eine invariante Kultur handelt.The culture name in the format languagecode2-country/regioncode2, if the current CultureInfo is culture-dependent; or an empty string, if it's an invariant culture. languagecode2 ist ein aus ISO 639-1 abgeleiteter, aus zwei Kleinbuchstaben bestehender Code.languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 ist aus ISO 3166 abgeleitet und verwendet normalerweise zwei Großbuchstaben oder ein BCP-47-Sprachtag.country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.

Beispiele

Im folgenden Codebeispiel werden mehrere Eigenschaften der neutralen Kulturen angezeigt.The following code example displays several properties of the neutral cultures.

Hinweis

Im Beispiel werden die Namen der älteren zh-CHS-und zh-CHT-Kultur mit den Kultur Bezeichner"0x0004" und "0x7C04" angezeigt.The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. Allerdings sollten Ihre Windows Vista-Anwendungen den zh-Hans-Namen anstelle von zh-CHS und den zh-Hant-Namen anstelle von zh-CHT verwenden.However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. Die Namen zh-Hans und zh-Hant stellen den aktuellen Standard dar und sollten verwendet werden, es sei denn, Sie haben einen Grund für die Verwendung älterer Namen.The zh-Hans and zh-Hant names represent the current standard, and should be used unless you have a reason for using the older names.

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-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)                    
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                                 
zh      zh  zho CHS Chinese                                  Chinese                                 
zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)                   
zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy             
zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy            

*/
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-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)
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
zh      zh  zho CHS Chinese                                  Chinese
zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)
zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy
zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy

*/
Imports System.Globalization

Module Module1

   Public 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



'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-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)                    
'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                                 
'zh      zh  zho CHS Chinese                                  Chinese                                 
'zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)                   
'zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy             
'zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy            

End Module

Hinweise

Eine Liste der vordefinierten Kultur Namen und Bezeichner, die Name von der Eigenschaft auf Windows-Systemen zurückgegeben werden können, finden Sie in der Spalte Sprachtag in der Liste der von Windows unterstützten Sprachen/Regions Namen.For a list of predefined culture names and identifiers that the Name property can return on Windows systems, see the Language tag column in the list of language/region names supported by Windows. Kulturnamen befolgen den von BCP 47 definierten Standard.Culture names follow the standard defined by BCP 47. Außerdem kann ab Windows 10 name ein beliebiges gültiges bcp-47-Sprachtag sein.In addition, starting with Windows 10, name can be any valid BCP-47 language tag. Beachten Sie, dass Kultur Namen geändert werden und dass Sie auch die Namen von benutzerdefinierten Kulturen widerspiegeln können.Note that culture names are subject to change, and that they also can reflect the names of custom cultures.

Die- CultureInfo.Name Eigenschaft folgt den namens Standards, die im-Thema der-Klasse bereitgestellt werden CultureInfoThe CultureInfo.Name property follows the naming standards provided in the CultureInfo class topic. Sie gibt die Kurzform des Kultur namens zurück, die alle Anzeichen einer alternativen Sortierreihenfolge ausschließt.It returns the short form of the culture name that excludes any indication of an alternate sort order. Wenn Sie z. b. ein-Objekt instanziieren, CultureInfo indem Sie die Zeichenfolge "de-de_phoneb" verwenden, um eine Alternative Sortierreihenfolge widerzuspiegeln, Name gibt die Eigenschaft "de-de" zurück.For example, if you instantiate a CultureInfo object by using the string "de-DE_phoneb" to reflect an alternate sort order, the Name property returns "de-DE".

Um den vollständigen Namen der Kultur zu erhalten, sollten Sie die- DisplayName ,-oder-Eigenschaft verwenden EnglishName NativeName .To get the full name of the culture, you should use the DisplayName, EnglishName, or NativeName property.

Gilt für:

Weitere Informationen