Questo articolo è stato tradotto automaticamente. Per visualizzare l'articolo in inglese, selezionare la casella di controllo Inglese. È possibile anche visualizzare il testo inglese in una finestra popup posizionando il puntatore del mouse sopra il testo.

Proprietà CultureInfo.Parent


Ottiene l'oggetto CultureInfo che rappresenta le impostazioni cultura padre dell'oggetto CultureInfo corrente.

Spazio dei nomi:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public virtual CultureInfo Parent { get; }

Valore proprietà

Type: System.Globalization.CultureInfo

Oggetto CultureInfo che rappresenta le impostazioni cultura padre dell'oggetto CultureInfo corrente.

The cultures have a hierarchy in which the parent of a specific culture is a neutral culture, the parent of a neutral culture is the P:System.Globalization.CultureInfo.InvariantCulture, and the parent of the P:System.Globalization.CultureInfo.InvariantCulture is the invariant culture itself. The parent culture encompasses only the set of information that is common among its children.

If the resources for the specific culture are not available in the system, the resources for the neutral culture are used. If the resources for the neutral culture are not available, the resources embedded in the main assembly are used. For more information on the resource fallback process, see Packaging and Deploying Resources in Desktop Apps.

The following code example determines the parent culture of each specific culture using the Chinese language.


The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. 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 System;
using System.Globalization;

public class SamplesCultureInfo

   public static void Main()

      // Prints the header.
      Console.WriteLine("SPECIFIC CULTURE                                     PARENT CULTURE");

      // Determines the specific cultures that use the Chinese language, and displays the parent culture.
      foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
         if (ci.TwoLetterISOLanguageName == "zh")
            Console.Write("0x{0} {1} {2,-40}", ci.LCID.ToString("X4"), ci.Name, ci.EnglishName);
            Console.WriteLine("0x{0} {1} {2}", ci.Parent.LCID.ToString("X4"), ci.Parent.Name, ci.Parent.EnglishName);



This code produces the following output.

SPECIFIC CULTURE                                     PARENT CULTURE
0x0404 zh-TW Chinese (Traditional, Taiwan)           0x7C04 zh-CHT Chinese (Traditional) Legacy
0x0804 zh-CN Chinese (Simplified, PRC)               0x0004 zh-CHS Chinese (Simplified) Legacy
0x0C04 zh-HK Chinese (Traditional, Hong Kong S.A.R.) 0x7C04 zh-CHT Chinese (Traditional) Legacy
0x1004 zh-SG Chinese (Simplified, Singapore)         0x0004 zh-CHS Chinese (Simplified) Legacy
0x1404 zh-MO Chinese (Traditional, Macao S.A.R.)     0x7C04 zh-CHT Chinese (Traditional) Legacy


Universal Windows Platform
Disponibile da 4.5
.NET Framework
Disponibile da 1.1
Portable Class Library
Supportato in: portable .NET platforms
Disponibile da 2.0
Windows Phone Silverlight
Disponibile da 7.0
Windows Phone
Disponibile da 8.1
Torna all'inizio