.NET Framework Class Library
CultureInfoGetCultures Method

Gets the list of supported cultures filtered by the specified CultureTypes parameter.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)
Syntax
Public Shared Function GetCultures ( _
	types As [%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_0_0_0%] _
) As [%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_0_0_1%]()
public static [%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_1_0_0%][] GetCultures(
	[%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_1_0_1%] types
)
public:
static array<[%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_2_0_0%]^>^ GetCultures(
	[%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_2_0_1%] types
)
static member GetCultures : 
        types:[%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_3_0_0%] -> [%$TOPIC/ba5k2bxz_en-us_VS_110_2_0_3_0_1%][] 

Parameters

types
Type: System.GlobalizationCultureTypes

A bitwise combination of the enumeration values that filter the cultures to retrieve.

Return Value

Type: System.GlobalizationCultureInfo
An array that contains the cultures specified by the types parameter. The array of cultures is unsorted.
Exceptions
ExceptionCondition
ArgumentOutOfRangeException

types specifies an invalid combination of CultureTypes values.

Remarks

The GetCultures method is most commonly called with the types parameter set to the following values:

Examples

The following code example displays several properties of the neutral cultures.

NoteNote

The example displays the zh-CHS and zh-CHT cultures 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.

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
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            

*/
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            

*/
Version Information

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

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.