다음을 통해 공유


CultureInfo.GetCultures 메서드

지정된 CultureTypes 매개 변수에 의해 필터링된 지원 culture 목록을 가져옵니다.

네임스페이스: System.Globalization
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Shared Function GetCultures ( _
    types As CultureTypes _
) As CultureInfo()
‘사용 방법
Dim types As CultureTypes
Dim returnValue As CultureInfo()

returnValue = CultureInfo.GetCultures(types)
public static CultureInfo[] GetCultures (
    CultureTypes types
)
public:
static array<CultureInfo^>^ GetCultures (
    CultureTypes types
)
public static CultureInfo[] GetCultures (
    CultureTypes types
)
public static function GetCultures (
    types : CultureTypes
) : CultureInfo[]

매개 변수

  • types
    검색할 culture를 필터링하는 CultureTypes 값의 비트 조합입니다.

반환 값

types 매개 변수로 지정된 culture가 포함된 CultureInfo 형식의 배열입니다. culture의 배열은 정렬되어 있지 않습니다.

예외

예외 형식 조건

ArgumentOutOfRangeException

types가 잘못된 CultureTypes 값 조합을 지정하는 경우

설명

types 매개 변수를 SpecificCultures 값으로 설정하면 모든 특정 culture가 반환됩니다. types를 NeutralCultures 값으로 설정하면 모든 중립 culture와 불변 culture를 반환합니다. types를 AllCultures 값으로 설정하면 모든 중립 및 특정 culture, Windows 시스템에 설치된 culture, 사용자가 만든 사용자 지정 culture 등이 반환됩니다.

예제

다음 코드 예제에서는 중립 culture의 여러 가지 속성을 표시합니다.

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

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

*/
import System.* ;
import System.Globalization.* ;

public class SamplesCultureInfo
{
     public static void main(String[] args)
    {
        // Displays several properties of the neutral cultures.
        Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME                  " 
            + "            ENGLISHNAME");
        
        for (int iCtr = 0; 
            iCtr < (CultureInfo.GetCultures(CultureTypes.NeutralCultures).
            length); iCtr++) {
            CultureInfo ci = 
                CultureInfo.GetCultures(CultureTypes.NeutralCultures)[iCtr];
            Console.Write("{0,-7}", ci.get_Name());
            Console.Write(" {0,-3}", ci.get_TwoLetterISOLanguageName());
            Console.Write(" {0,-3}", ci.get_ThreeLetterISOLanguageName());
            Console.Write(" {0,-3}", ci.get_ThreeLetterWindowsLanguageName());
            Console.Write(" {0,-40}", ci.get_DisplayName());
            Console.WriteLine(" {0,-40}", ci.get_EnglishName());
        }
    } //main 
} //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
*/

플랫폼

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

CultureInfo 클래스
CultureInfo 멤버
System.Globalization 네임스페이스
CultureTypes