CultureInfo.Name CultureInfo.Name CultureInfo.Name CultureInfo.Name Property

Definizione

Ottiene il nome delle impostazioni cultura nel formato codicelingua2-codicepaese2.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

Valore della proprietà

Il nome delle impostazioni cultura nel formato codicelingua2-codicepaese2.The culture name in the format languagecode2-country/regioncode2. codicelingua2 è un codice di due lettere minuscole derivato da ISO 639-1.languagecode2 is a lowercase two-letter code derived from ISO 639-1. codicepaese2 è derivato da ISO 3166 e in genere costituito da due lettere maiuscole o da un tag di lingua BCP-47.country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.

Esempi

Esempio di codice seguente consente di visualizzare diverse proprietà delle impostazioni cultura neutre.The following code example displays several properties of the neutral cultures.

Nota

Nell'esempio vengono visualizzati i nomi delle impostazioni cultura precedenti zh-CHT e zh-CHS con gli identificatori delle impostazioni cultura 0x0004 e 0x7C04, rispettivamente.The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. Tuttavia, le applicazioni di Windows Vista dovrebbero utilizzare il nome di zh-Hans anziché il nome di zh-Hant anziché zh-CHT e zh-CHS.However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. Il zh-Hans e zh-Hant nomi rappresentano lo standard corrente e deve essere utilizzati a meno che non esista un motivo per utilizzare i nomi precedenti.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
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 'Main 



'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

Commenti

Per un elenco di nomi predefiniti delle impostazioni cultura e gli identificatori che il Name proprietà può restituire su Windows i sistemi, vedere la tag di lingua colonna il elenco di nomi di lingua/area geografica supportati da Windows.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. Nomi delle impostazioni cultura seguono lo standard definito da BCP 47.Culture names follow the standard defined by BCP 47. Inoltre, a partire da Windows 10, name può essere qualsiasi tag di lingua BCP-47 valido.In addition, starting with Windows 10, name can be any valid BCP-47 language tag. Si noti che i nomi delle impostazioni cultura sono soggetti a modifiche, e che inoltre può riflettono i nomi delle impostazioni cultura personalizzate.Note that culture names are subject to change, and that they also can reflect the names of custom cultures.

Il CultureInfo.Name proprietà conforme agli standard di denominazione forniti nel CultureInfo argomento relativo alla classe.The CultureInfo.Name property follows the naming standards provided in the CultureInfo class topic. Restituisce la versione abbreviata del nome delle impostazioni cultura che esclude alcuna indicazione di un ordinamento alternativo.It returns the short form of the culture name that excludes any indication of an alternate sort order. Ad esempio, se crea un'istanza di un CultureInfo oggetto usando la stringa "de-de phoneb" in modo da riflettere un ordinamento alternativo, il Name proprietà restituisce "de-DE".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".

Per ottenere il nome completo delle impostazioni cultura, è consigliabile usare la DisplayName, EnglishName, o NativeName proprietà.To get the full name of the culture, you should use the DisplayName, EnglishName, or NativeName property.

Si applica a

Vedi anche