CultureInfo.CultureTypes Property

Gets the culture types that pertain to the current CultureInfo object.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(false)]
public CultureTypes CultureTypes { get; }

Property Value

Type: System.Globalization.CultureTypes
A bitwise combination of one or more CultureTypes values. There is no default value.

The following code example demonstrates the CultureTypes enumeration and the CultureTypes property.

// This example demonstrates the CultureTypes enumeration  
// and the CultureInfo.CultureTypes property. 

using System;
using System.Globalization;

class Sample
{
    public static void Main()
    {
        // Create a table of most culture types. 
        CultureTypes[] mostCultureTypes = new CultureTypes[] {
                        CultureTypes.NeutralCultures, 
                        CultureTypes.SpecificCultures, 
                        CultureTypes.InstalledWin32Cultures, 
                        CultureTypes.UserCustomCulture, 
                        CultureTypes.ReplacementCultures, 
                        CultureTypes.FrameworkCultures,
                        CultureTypes.WindowsOnlyCultures
                        };
        CultureInfo[] allCultures;
        CultureTypes combo;

        // Get and enumerate all cultures.
        allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
        foreach (CultureInfo ci in allCultures)
        {
            // Display the name of each culture.
            Console.WriteLine("Culture: {0}", ci.Name);

            // Get the culture types of each culture. 
            combo = ci.CultureTypes;

            // Display the name of each culture type flag that is set.
            Console.Write("  ");
            foreach (CultureTypes ct in mostCultureTypes)
                if (0 != (ct & combo))
                    Console.Write("{0} ", ct);
            Console.WriteLine();
        }
    }
}

/*
The following is a portion of the results produced by this code example.
.
.
.
Culture: tg
  NeutralCultures InstalledWin32Cultures 
Culture: ta
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: te
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl-TJ
  SpecificCultures InstalledWin32Cultures 
Culture: ta-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: te-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr-SY
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl
  NeutralCultures InstalledWin32Cultures 
.
.
.
*/

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft