CultureTypes Enumeration
Defines the types of culture lists that can be retrieved using CultureInfo.GetCultures.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
[Visual Basic] <Flags> <Serializable> Public Enum CultureTypes [C#] [Flags] [Serializable] public enum CultureTypes [C++] [Flags] [Serializable] __value public enum CultureTypes [JScript] public Flags Serializable enum CultureTypes
Remarks
These culture types serve as a filter that limits which cultures are returned by CultureInfo.GetCultures.
For more information on cultures, see CultureInfo.
Members
| Member name | Description | Value |
|---|---|---|
| AllCultures Supported by the .NET Compact Framework. | Refers to all cultures. | 7 |
| InstalledWin32Cultures Supported by the .NET Compact Framework. | Refers to all cultures that are installed in the Windows system. Note that not all cultures supported by the .NET Framework are installed in the Windows system. | 4 |
| NeutralCultures Supported by the .NET Compact Framework. | Refers to cultures that are associated with a language but are not specific to a country/region. The names of these cultures consist of the lowercase two-letter code derived from ISO 639-1. For example: "en" (English) is a neutral culture. The invariant culture is included in the array of cultures returned by CultureInfo.GetCultures with this value. | 1 |
| SpecificCultures Supported by the .NET Compact Framework. | Refers to cultures that are specific to a country/region. The names of these cultures follow the RFC 1766 standard in the format "<languagecode2>-<country/regioncode2>", where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. For example, "en-US" (English - United States) is a specific culture. | 2 |
Example
[Visual Basic, C#, C++] The following code example displays several properties of the neutral cultures.
[Visual Basic] 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 [C#] 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 */ [C++] #using <mscorlib.dll> using namespace System; using namespace System::Globalization; int main() { // Displays several properties of the neutral cultures. Console::WriteLine( S"CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME" ); System::Collections::IEnumerator* enum0 = CultureInfo::GetCultures(CultureTypes::NeutralCultures)->GetEnumerator(); while (enum0->MoveNext()) { CultureInfo* ci = __try_cast<CultureInfo*>(enum0->Current); Console::Write( S"{0,-7}", ci->Name ); Console::Write( S" {0,-3}", ci->TwoLetterISOLanguageName ); Console::Write( S" {0,-3}", ci->ThreeLetterISOLanguageName ); Console::Write( S" {0,-3}", ci->ThreeLetterWindowsLanguageName ); Console::Write( S" {0,-40}", ci->DisplayName ); Console::WriteLine( S" {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 */
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Namespace: System.Globalization
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework
Assembly: Mscorlib (in Mscorlib.dll)