CultureTypes 열거형

정의

GetCultures(CultureTypes) 메서드를 사용하여 검색할 수 있는 문화권 목록 유형을 정의합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class CultureTypes
[System.Flags]
public enum CultureTypes
[System.Flags]
[System.Serializable]
public enum CultureTypes
[System.Flags]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum CultureTypes
[<System.Flags>]
type CultureTypes = 
[<System.Flags>]
[<System.Serializable>]
type CultureTypes = 
[<System.Flags>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type CultureTypes = 
Public Enum CultureTypes
상속
CultureTypes
특성

필드

AllCultures 7

중립 및 특정 문화권 및 사용자가 만든 사용자 지정 문화권을 포함하여 .NET에서 인식되는 모든 문화권입니다.

Windows에서 실행되는 .NET Framework 4 이상 버전 및 .NET Core의 경우 Windows 운영 체제에서 사용할 수 있는 문화권 데이터를 포함합니다. Linux 및 macOS에서 실행되는 .NET Core의 경우 ICU 라이브러리에 정의된 문화권 데이터를 포함합니다.

AllCulturesNeutralCultures, SpecificCulturesInstalledWin32Cultures 값을 포함하는 복합 필드입니다.

FrameworkCultures 64

이 멤버는 더 이상 사용되지 않습니다. 이 값을 GetCultures(CultureTypes)와 함께 사용하면 .NET Framework 2.0과 함께 제공되는 중립 및 특정 문화권이 반환됩니다.

InstalledWin32Cultures 4

이 멤버는 더 이상 사용되지 않습니다. Windows 운영 체제에 설치된 모든 문화권입니다.

NeutralCultures 1

한 언어와 연결되어 있지만 특정 국가/지역에 국한되지 않은 문화권입니다.

ReplacementCultures 16

이 멤버는 더 이상 사용되지 않습니다. .NET Framework와 함께 제공되는 문화권을 대신하는, 사용자가 만든 사용자 지정 문화권입니다.

SpecificCultures 2

한 국가/지역에 국한된 문화권입니다.

UserCustomCulture 8

이 멤버는 더 이상 사용되지 않습니다. 사용자가 만든 사용자 지정 문화권입니다.

WindowsOnlyCultures 32

이 멤버는 더 이상 사용되지 않고 무시됩니다.

예제

다음 예제에서는 CultureTypes.AllCultures 열거형 멤버 및 속성을 보여 줍니다 CultureTypes .

using System;
using System.Globalization;

class Sample
{
    public static void Main()
    {
        // Get and enumerate all cultures.
        var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
        foreach (var ci in allCultures)
        {
            // Display the name of each culture.
            Console.Write($"{ci.EnglishName} ({ci.Name}): ");
            // Indicate the culture type.
            if (ci.CultureTypes.HasFlag(CultureTypes.NeutralCultures))
               Console.Write(" NeutralCulture");
            if (ci.CultureTypes.HasFlag(CultureTypes.SpecificCultures))
               Console.Write(" SpecificCulture");
            Console.WriteLine();
        }
    }
}
/*
The following is a portion of the output from this example.
      Tajik (tg):  NeutralCulture
      Tajik (Cyrillic) (tg-Cyrl):  NeutralCulture
      Tajik (Cyrillic, Tajikistan) (tg-Cyrl-TJ):  SpecificCulture
      Thai (th):  NeutralCulture
      Thai (Thailand) (th-TH):  SpecificCulture
      Tigrinya (ti):  NeutralCulture
      Tigrinya (Eritrea) (ti-ER):  SpecificCulture
      Tigrinya (Ethiopia) (ti-ET):  SpecificCulture
      Tigre (tig):  NeutralCulture
      Tigre (Eritrea) (tig-ER):  SpecificCulture
      Turkmen (tk):  NeutralCulture
      Turkmen (Turkmenistan) (tk-TM):  SpecificCulture
      Setswana (tn):  NeutralCulture
      Setswana (Botswana) (tn-BW):  SpecificCulture
      Setswana (South Africa) (tn-ZA):  SpecificCulture
*/
Imports System.Globalization

Module Module1
    Public Sub Main()
        ' Get and enumerate all cultures.
        Dim allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures)
         For Each ci In allCultures
            ' Display the name of each culture.
            Console.Write($"{ci.EnglishName} ({ci.Name}): ")
            ' Indicate the culture type. 
            If ci.CultureTypes.HasFlag(CultureTypes.NeutralCultures) Then
               Console.Write(" NeutralCulture")
            End If   
            If ci.CultureTypes.HasFlag(CultureTypes.SpecificCultures) Then
               Console.Write(" SpecificCulture")
            End If   
            Console.WriteLine()
        Next
    End Sub  
End Module
' The following is a portion of the output from this example.
'            Tajik (tg):  NeutralCulture
'            Tajik (Cyrillic) (tg-Cyrl):  NeutralCulture
'            Tajik (Cyrillic, Tajikistan) (tg-Cyrl-TJ):  SpecificCulture
'            Thai (th):  NeutralCulture
'            Thai (Thailand) (th-TH):  SpecificCulture
'            Tigrinya (ti):  NeutralCulture
'            Tigrinya (Eritrea) (ti-ER):  SpecificCulture
'            Tigrinya (Ethiopia) (ti-ET):  SpecificCulture
'            Tigre (tig):  NeutralCulture
'            Tigre (Eritrea) (tig-ER):  SpecificCulture
'            Turkmen (tk):  NeutralCulture
'            Turkmen (Turkmenistan) (tk-TM):  SpecificCulture
'            Setswana (tn):  NeutralCulture
'            Setswana (Botswana) (tn-BW):  SpecificCulture
'            Setswana (South Africa) (tn-ZA):  SpecificCulture

다음 예제에서는 중립 문화권의 여러 속성을 표시합니다.

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            

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

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



'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

설명

이러한 문화권 형식 값은 속성에서 CultureInfo.CultureTypes 반환되며 메서드에서 반환 CultureInfo.GetCultures 되는 문화권을 제한하는 필터로도 사용할 수 있습니다. 문화권에 대한 자세한 내용은 을 참조하세요 CultureInfo.

일반적으로 값을 사용하여 모든 문화권을 열거합니다 CultureTypes.AllCultures . 이렇게 하면 사용자 지정 문화권과 다른 문화권 형식을 열거할 수 있습니다.

, CultureTypes.NeutralCulturesCultureTypes.SpecificCultures을 제외한 CultureTypes.AllCultures모든 CultureTypes 멤버는 더 이상 사용되지 않습니다.

.NET은 열거형 멤버가 반환하는 열거형에 모두 포함된 다음 문화권 형식을 CultureTypes.AllTypes 인식합니다.

  • 국가/지역 및 언어를 지정하는 특정 문화권 이러한 문화권의 이름은 RFC 4646을 따릅니다. 형식은 입니다 <languagecode2>-<country/regioncode2>. 여기서 <languagecode2> 는 ISO 639-1에서 파생된 소문자 2자 코드이며 <country/regioncode2> ISO 3166에서 파생된 대문자 2자 코드입니다. 예를 들어 영어(미국)에 해당하는 "en-US"는 특정 문화권입니다. 사용자 지정 특정 문화권(즉, 시스템 정의가 아닌 애플리케이션인 문화권)은 표준 규격 이름뿐만 아니라 사용자 지정 이름을 가질 수 있습니다.

  • 국가/지역에 관계없이 언어를 지정하는 중립 문화권입니다. 중립 문화권의 이름은 ISO 639-1에서 파생된 소문자 두 글자 코드로 구성됩니다. 예: "en"(영어)은 중립 문화권입니다. 사용자 지정 중립 문화권(즉, 시스템 정의가 아닌 애플리케이션인 문화권)은 두 글자 코드뿐만 아니라 사용자 지정 이름을 가질 수 있습니다.

    고정 문화권은 이 값을 지정하는 메서드에서 반환하는 문화권 배열에 CultureInfo.GetCultures 포함됩니다.

  • 애플리케이션 정의 문화권인 사용자 지정 문화권입니다. 사용자 지정 문화권은 특정 문화권 또는 중립 문화권을 나타낼 수 있으며 애플리케이션에서 지정한 이름을 가질 수 있습니다.

    Windows 10 UserCustomCulture 이전 Windows 버전에서 값은 개발자가 만든 사용자 지정 문화권에 할당됩니다. Windows 10 UserCustomCulture 전체 문화권 데이터 집합에서 지원하지 않고 고유한 로컬 식별자가 없는 시스템 문화권에도 값이 할당됩니다. 형식 UserCustomCulture 의 모든 문화권은 값을 LOCALE_CUSTOM_UNSPECIFIED 공유 CultureInfo.LCID 합니다(0x1000 또는 4096). 결과적으로 메서드는 CultureInfo.GetCultures(CultureTypes.UserCustomCulture) 다른 Windows 버전에서 서로 다른 문화권 집합을 반환합니다.

적용 대상

추가 정보