CultureInfo.CreateSpecificCulture(String) 메서드
정의
지정된 이름과 관련된 특정 문화권을 나타내는 CultureInfo을(를) 만듭니다.Creates a CultureInfo that represents the specific culture that is associated with the specified name.
public:
static System::Globalization::CultureInfo ^ CreateSpecificCulture(System::String ^ name);
public static System.Globalization.CultureInfo CreateSpecificCulture (string name);
static member CreateSpecificCulture : string -> System.Globalization.CultureInfo
Public Shared Function CreateSpecificCulture (name As String) As CultureInfo
매개 변수
- name
- String
미리 정의된 CultureInfo의 이름 또는 기존 CultureInfo 개체의 이름입니다.A predefined CultureInfo name or the name of an existing CultureInfo object. name
은(는) 대/소문자를 구분하지 않습니다.name
is not case-sensitive.
반환
다음을 나타내는 CultureInfo 개체입니다.A CultureInfo object that represents:
name
이 빈 문자열("")인 경우 고정 문화권The invariant culture, if name
is an empty string ("").
-또는--or-
name
이 중립 문화권인 경우 name
과 연관된 특정 문화권The specific culture associated with name
, if name
is a neutral culture.
-또는--or-
name
이 이미 특정 문화권인 경우 name
이 지정하는 문화권입니다.The culture specified by name
, if name
is already a specific culture.
예외
name
이 유효한 문화권 이름이 아닙니다.name
is not a valid culture name.
-또는--or-
name
에 지정된 문화권에 특정 문화권이 연결되어 있지 않습니다.The culture specified by name
does not have a specific culture associated with it.
name
가 null인 경우name
is null.
예제
다음 예제에서는 배열을 검색 CultureInfo 중립 문화권을 나타내는 개체를 GetCultures 메서드 배열 정렬 합니다.The following example retrieves an array of CultureInfo objects that represent neutral cultures from the GetCultures method and sorts the array. 배열의 요소를 반복 하면서 각 중립 문화권의 이름을 전달 합니다 CreateSpecificCulture 메서드와 메서드에서 반환 하는 특정 문화권의 이름을 표시 합니다.When it iterates the elements in the array, it passes the name of each neutral culture to the CreateSpecificCulture method and displays the name of the specific culture returned by the method.
참고
이 예제에서는 ZH-CHS 및 ZH-CHT 문화권 이름을 사용합니다.The example uses the zh-CHS and zh-CHT culture names. 그러나 Windows Vista를 대상 나중 ZH-CHS 및 ZH-CHT 대신 Zh-hant 대신 Zh-hans를 사용 해야 하는 애플리케이션입니다.However, applications that target Windows Vista and later should use zh-Hans instead of zh-CHS and zh-Hant instead of zh-CHT. Zh-hans 및 Zh-hant 현재 표준 나타내고 이전 이름을 사용 하는 것에 대 한 이유가 없다면 사용 해야 합니다.zh-Hans and zh-Hant represent the current standard and should be used unless you have a reason for using the older names.
예제의 결과 중국어 (번체) 중립 문화권 (zh, ZH-CHT, 또는 Zh-hant)의 입력 ZH-TW 돌아갑니다, 대만 Windows 설치에서 달라질 수 있습니다는 또한 note 합니다.Note also that the results of the example may differ on an installation of Taiwanese Windows, where the input of a Chinese (Traditional) neutral culture (zh, zh-CHT, or zh-Hant) will return zh-TW.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
public class Example
{
public static void Main()
{
// Display the header.
Console.WriteLine("{0,-53}{1}", "CULTURE", "SPECIFIC CULTURE");
// Get each neutral culture in the .NET Framework.
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.NeutralCultures);
// Sort the returned array by name.
Array.Sort<CultureInfo>(cultures, new NamePropertyComparer<CultureInfo>());
// Determine the specific culture associated with each neutral culture.
foreach (var culture in cultures)
{
Console.Write("{0,-12} {1,-40}", culture.Name, culture.EnglishName);
try {
Console.WriteLine("{0}", CultureInfo.CreateSpecificCulture(culture.Name).Name);
}
catch (ArgumentException) {
Console.WriteLine("(no associated specific culture)");
}
}
}
}
public class NamePropertyComparer<T> : IComparer<T>
{
public int Compare(T x, T y)
{
if (x == null)
if (y == null)
return 0;
else
return -1;
PropertyInfo pX = x.GetType().GetProperty("Name");
PropertyInfo pY = y.GetType().GetProperty("Name");
return String.Compare((string) pX.GetValue(x, null), (string) pY.GetValue(y, null));
}
}
// The example displays the following output on a Windows system. This output has been cropped for brevity.
// CULTURE SPECIFIC CULTURE
// Invariant Language (Invariant Country)
// aa Afar aa-ET
// af Afrikaans af-ZA
// agq Aghem agq-CM
// ak Akan ak-GH
// am Amharic am-ET
// ar Arabic ar-SA
// arn Mapudungun arn-CL
// as Assamese as-IN
// asa Asu asa-TZ
// ast Asturian ast-ES
// az Azerbaijani az-Latn-AZ
// az-Cyrl Azerbaijani (Cyrillic) az-Cyrl-AZ
// az-Latn Azerbaijani (Latin) az-Latn-AZ
// ba Bashkir ba-RU
// bas Basaa bas-CM
// be Belarusian be-BY
// bem Bemba bem-ZM
// bez Bena bez-TZ
// bg Bulgarian bg-BG
// bin Edo bin-NG
// bm Bamanankan bm-Latn-ML
// bm-Latn Bamanankan (Latin) bm-Latn-ML
// bn Bangla bn-BD
// bo Tibetan bo-CN
// br Breton br-FR
// brx Bodo brx-IN
// bs Bosnian bs-Latn-BA
// bs-Cyrl Bosnian (Cyrillic) bs-Cyrl-BA
// bs-Latn Bosnian (Latin) bs-Latn-BA
// byn Blin byn-ER
// ca Catalan ca-ES
// ce Chechen ce-RU
// cgg Chiga cgg-UG
// chr Cherokee chr-Cher-US
// chr-Cher Cherokee chr-Cher-US
// co Corsican co-FR
// cs Czech cs-CZ
// cu Church Slavic cu-RU
// cy Welsh cy-GB
// da Danish da-DK
// dav Taita dav-KE
// de German de-DE
// dje Zarma dje-NE
// dsb Lower Sorbian dsb-DE
// dua Duala dua-CM
// dv Divehi dv-MV
// ...
// ta Tamil ta-IN
// te Telugu te-IN
// teo Teso teo-UG
// tg Tajik tg-Cyrl-TJ
// tg-Cyrl Tajik (Cyrillic) tg-Cyrl-TJ
// th Thai th-TH
// ti Tigrinya ti-ER
// tig Tigre tig-ER
// tk Turkmen tk-TM
// tn Setswana tn-ZA
// to Tongan to-TO
// tr Turkish tr-TR
// ts Tsonga ts-ZA
// tt Tatar tt-RU
// twq Tasawaq twq-NE
// tzm Central Atlas Tamazight tzm-Latn-DZ
// tzm-Arab Central Atlas Tamazight (Arabic) tzm-Arab-MA
// tzm-Latn Central Atlas Tamazight (Latin) tzm-Latn-DZ
// tzm-Tfng Central Atlas Tamazight (Tifinagh) tzm-Tfng-MA
// ug Uyghur ug-CN
// uk Ukrainian uk-UA
// ur Urdu ur-PK
// uz Uzbek uz-Latn-UZ
// uz-Arab Uzbek (Perso-Arabic) uz-Arab-AF
// uz-Cyrl Uzbek (Cyrillic) uz-Cyrl-UZ
// uz-Latn Uzbek (Latin) uz-Latn-UZ
// vai Vai vai-Vaii-LR
// vai-Latn Vai (Latin) vai-Latn-LR
// vai-Vaii Vai (Vai) vai-Vaii-LR
// ve Venda ve-ZA
// vi Vietnamese vi-VN
// vo Volapük vo-001
// vun Vunjo vun-TZ
// wae Walser wae-CH
// wal Wolaytta wal-ET
// wo Wolof wo-SN
// xh isiXhosa xh-ZA
// xog Soga xog-UG
// yav Yangben yav-CM
// yi Yiddish yi-001
// yo Yoruba yo-NG
// zgh Standard Moroccan Tamazight zgh-Tfng-MA
// zgh-Tfng Standard Moroccan Tamazight (Tifinagh) zgh-Tfng-MA
// zh Chinese zh-CN
// zh-CHS Chinese (Simplified) Legacy zh-CN
// zh-CHT Chinese (Traditional) Legacy zh-HK
// zh-Hans Chinese (Simplified) zh-CN
// zh-Hant Chinese (Traditional) zh-HK
// zu isiZulu zu-ZA
// The example displays output like the following on a Unix-based system. The output has been cropped for brevity.
CULTURE SPECIFIC CULTURE
// Invariant Language (Invariant Country)
// af Afrikaans af-ZA
// agq Aghem agq-CM
// ak Akan ak-GH
// am Amharic am-ET
// ar Arabic ar-SA
// as Assamese as-IN
// asa Asu asa-TZ
// ast Asturian ast-ES
// az Azerbaijani az-Latn-AZ
// az-Cyrl Azerbaijani az-Cyrl-AZ
// az-Latn Azerbaijani az-Latn-AZ
// bas Basaa bas-CM
// be Belarusian be-BY
// bem Bemba bem-ZM
// bez Bena bez-TZ
// bg Bulgarian bg-BG
// bm Bambara bm-Latn-ML
// bn Bangla bn-BD
// bo Tibetan bo-CN
// br Breton br-FR
// brx Bodo brx-IN
// bs Bosnian bs-Latn-BA
// bs-Cyrl Bosnian bs-Cyrl-BA
// bs-Latn Bosnian bs-Latn-BA
// ca Catalan ca-ES
// ccp Chakma
// ce Chechen ce-RU
// cgg Chiga cgg-UG
// chr Cherokee chr-Cher-US
// ckb Central Kurdish
// cs Czech cs-CZ
// cy Welsh cy-GB
// da Danish da-DK
// dav Taita dav-KE
// de German de-DE
// dje Zarma dje-NE
// dsb Lower Sorbian dsb-DE
// dua Duala dua-CM
// ...
// ta Tamil ta-IN
// te Telugu te-IN
// teo Teso teo-UG
// tg Tajik tg-Cyrl-TJ
// th Thai th-TH
// ti Tigrinya ti-ER
// to Tongan to-TO
// tr Turkish tr-TR
// tt Tatar tt-RU
// twq Tasawaq twq-NE
// tzm Central Atlas Tamazight tzm-Latn-DZ
// ug Uyghur ug-CN
// uk Ukrainian uk-UA
// ur Urdu ur-PK
// uz Uzbek uz-Latn-UZ
// uz-Arab Uzbek uz-Arab-AF
// uz-Cyrl Uzbek uz-Cyrl-UZ
// uz-Latn Uzbek uz-Latn-UZ
// vai Vai vai-Vaii-LR
// vai-Latn Vai vai-Latn-LR
// vai-Vaii Vai vai-Vaii-LR
// vi Vietnamese vi-VN
// vun Vunjo vun-TZ
// wae Walser wae-CH
// wo Wolof wo-SN
// xog Soga xog-UG
// yav Yangben yav-CM
// yi Yiddish yi-001
// yo Yoruba yo-NG
// yue Cantonese yue-HK
// yue-Hans Cantonese
// yue-Hant Cantonese
// zgh Standard Moroccan Tamazight zgh-Tfng-MA
// zh Chinese zh-CN
// zh-Hans Chinese zh-CN
// zh-Hant Chinese zh-HK
// zu Zulu zu-ZA
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Reflection
Public Class Example
Public Shared Sub Main()
' Display the header.
Console.WriteLine("{0,-53}{1}", "CULTURE", "SPECIFIC CULTURE")
' Get each neutral culture in the .NET Framework.
Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.NeutralCultures)
' Sort the returned array by name.
Array.Sort(Of CultureInfo)(cultures, New NamePropertyComparer(Of CultureInfo)())
' Determine the specific culture associated with each neutral culture.
For Each culture As CultureInfo In cultures
Console.Write("{0,-12} {1,-40}", culture.Name, culture.EnglishName)
Try
Console.WriteLine("{0}", CultureInfo.CreateSpecificCulture(culture.Name).Name)
Catch e As ArgumentException
Console.WriteLine("(no associated specific culture)")
End Try
Next
End Sub
End Class
Public Class NamePropertyComparer(Of T) : Implements IComparer(Of T)
Public Function Compare(x As T, y As T) As Integer _
Implements IComparer(Of T).Compare
If x Is Nothing Then
If y Is Nothing Then
Return 0
Else
Return -1
End If
End If
Dim pX As PropertyInfo = x.GetType().GetProperty("Name")
Dim pY As PropertyInfo = y.GetType().GetProperty("Name")
Return String.Compare(CStr(pX.GetValue(x, Nothing)), CStr(pY.GetValue(y, Nothing)))
End Function
End Class
' The example displays the following output on a Windows system. This output has been cropped for brevity.
' CULTURE SPECIFIC CULTURE
Invariant Language (Invariant Country)
' aa Afar aa-ET
' af Afrikaans af-ZA
' agq Aghem agq-CM
' ak Akan ak-GH
' am Amharic am-ET
' ar Arabic ar-SA
' arn Mapudungun arn-CL
' as Assamese as-IN
' asa Asu asa-TZ
' ast Asturian ast-ES
' az Azerbaijani az-Latn-AZ
' az-Cyrl Azerbaijani (Cyrillic) az-Cyrl-AZ
' az-Latn Azerbaijani (Latin) az-Latn-AZ
' ba Bashkir ba-RU
' bas Basaa bas-CM
' be Belarusian be-BY
' bem Bemba bem-ZM
' bez Bena bez-TZ
' bg Bulgarian bg-BG
' bin Edo bin-NG
' bm Bamanankan bm-Latn-ML
' bm-Latn Bamanankan (Latin) bm-Latn-ML
' bn Bangla bn-BD
' bo Tibetan bo-CN
' br Breton br-FR
' brx Bodo brx-IN
' bs Bosnian bs-Latn-BA
' bs-Cyrl Bosnian (Cyrillic) bs-Cyrl-BA
' bs-Latn Bosnian (Latin) bs-Latn-BA
' byn Blin byn-ER
' ca Catalan ca-ES
' ce Chechen ce-RU
' cgg Chiga cgg-UG
' chr Cherokee chr-Cher-US
' chr-Cher Cherokee chr-Cher-US
' co Corsican co-FR
' cs Czech cs-CZ
' cu Church Slavic cu-RU
' cy Welsh cy-GB
' da Danish da-DK
' dav Taita dav-KE
' de German de-DE
' dje Zarma dje-NE
' dsb Lower Sorbian dsb-DE
' dua Duala dua-CM
' dv Divehi dv-MV
' ...
' ta Tamil ta-IN
' te Telugu te-IN
' teo Teso teo-UG
' tg Tajik tg-Cyrl-TJ
' tg-Cyrl Tajik (Cyrillic) tg-Cyrl-TJ
' th Thai th-TH
' ti Tigrinya ti-ER
' tig Tigre tig-ER
' tk Turkmen tk-TM
' tn Setswana tn-ZA
' to Tongan to-TO
' tr Turkish tr-TR
' ts Tsonga ts-ZA
' tt Tatar tt-RU
' twq Tasawaq twq-NE
' tzm Central Atlas Tamazight tzm-Latn-DZ
' tzm-Arab Central Atlas Tamazight (Arabic) tzm-Arab-MA
' tzm-Latn Central Atlas Tamazight (Latin) tzm-Latn-DZ
' tzm-Tfng Central Atlas Tamazight (Tifinagh) tzm-Tfng-MA
' ug Uyghur ug-CN
' uk Ukrainian uk-UA
' ur Urdu ur-PK
' uz Uzbek uz-Latn-UZ
' uz-Arab Uzbek (Perso-Arabic) uz-Arab-AF
' uz-Cyrl Uzbek (Cyrillic) uz-Cyrl-UZ
' uz-Latn Uzbek (Latin) uz-Latn-UZ
' vai Vai vai-Vaii-LR
' vai-Latn Vai (Latin) vai-Latn-LR
' vai-Vaii Vai (Vai) vai-Vaii-LR
' ve Venda ve-ZA
' vi Vietnamese vi-VN
' vo Volapük vo-001
' vun Vunjo vun-TZ
' wae Walser wae-CH
' wal Wolaytta wal-ET
' wo Wolof wo-SN
' xh isiXhosa xh-ZA
' xog Soga xog-UG
' yav Yangben yav-CM
' yi Yiddish yi-001
' yo Yoruba yo-NG
' zgh Standard Moroccan Tamazight zgh-Tfng-MA
' zgh-Tfng Standard Moroccan Tamazight (Tifinagh) zgh-Tfng-MA
' zh Chinese zh-CN
' zh-CHS Chinese (Simplified) Legacy zh-CN
' zh-CHT Chinese (Traditional) Legacy zh-HK
' zh-Hans Chinese (Simplified) zh-CN
' zh-Hant Chinese (Traditional) zh-HK
' zu isiZulu zu-ZA
' The example displays output like the following on a Unix-based system. The output has been cropped for brevity.
CULTURE SPECIFIC CULTURE
' Invariant Language (Invariant Country)
' af Afrikaans af-ZA
' agq Aghem agq-CM
' ak Akan ak-GH
' am Amharic am-ET
' ar Arabic ar-SA
' as Assamese as-IN
' asa Asu asa-TZ
' ast Asturian ast-ES
' az Azerbaijani az-Latn-AZ
' az-Cyrl Azerbaijani az-Cyrl-AZ
' az-Latn Azerbaijani az-Latn-AZ
' bas Basaa bas-CM
' be Belarusian be-BY
' bem Bemba bem-ZM
' bez Bena bez-TZ
' bg Bulgarian bg-BG
' bm Bambara bm-Latn-ML
' bn Bangla bn-BD
' bo Tibetan bo-CN
' br Breton br-FR
' brx Bodo brx-IN
' bs Bosnian bs-Latn-BA
' bs-Cyrl Bosnian bs-Cyrl-BA
' bs-Latn Bosnian bs-Latn-BA
' ca Catalan ca-ES
' ccp Chakma
' ce Chechen ce-RU
' cgg Chiga cgg-UG
' chr Cherokee chr-Cher-US
' ckb Central Kurdish
' cs Czech cs-CZ
' cy Welsh cy-GB
' da Danish da-DK
' dav Taita dav-KE
' de German de-DE
' dje Zarma dje-NE
' dsb Lower Sorbian dsb-DE
' dua Duala dua-CM
' ...
' ta Tamil ta-IN
' te Telugu te-IN
' teo Teso teo-UG
' tg Tajik tg-Cyrl-TJ
' th Thai th-TH
' ti Tigrinya ti-ER
' to Tongan to-TO
' tr Turkish tr-TR
' tt Tatar tt-RU
' twq Tasawaq twq-NE
' tzm Central Atlas Tamazight tzm-Latn-DZ
' ug Uyghur ug-CN
' uk Ukrainian uk-UA
' ur Urdu ur-PK
' uz Uzbek uz-Latn-UZ
' uz-Arab Uzbek uz-Arab-AF
' uz-Cyrl Uzbek uz-Cyrl-UZ
' uz-Latn Uzbek uz-Latn-UZ
' vai Vai vai-Vaii-LR
' vai-Latn Vai vai-Latn-LR
' vai-Vaii Vai vai-Vaii-LR
' vi Vietnamese vi-VN
' vun Vunjo vun-TZ
' wae Walser wae-CH
' wo Wolof wo-SN
' xog Soga xog-UG
' yav Yangben yav-CM
' yi Yiddish yi-001
' yo Yoruba yo-NG
' yue Cantonese yue-HK
' yue-Hans Cantonese
' yue-Hant Cantonese
' zgh Standard Moroccan Tamazight zgh-Tfng-MA
' zh Chinese zh-CN
' zh-Hans Chinese zh-CN
' zh-Hant Chinese zh-HK
' zu Zulu zu-ZA
설명
합니다 CreateSpecificCulture 메서드 호출을 래핑한는 CultureInfo(String) 생성자입니다.The CreateSpecificCulture method wraps a call to the CultureInfo(String) constructor.
참고
Windows 시스템에서 미리 정의 된 문화권 이름의 목록은 windows에서 지 원하는 언어/지역 이름 목록의 언어 태그 열을 참조 하세요.For a list of predefined culture names on Windows systems, see the Language tag column in the list of language/region names supported by Windows. 문화권 이름은 BCP 47에 정의된 표준을 따릅니다.Culture names follow the standard defined by BCP 47. 또한 Windows 10부터 name
유효한 BCP-47 언어 태그를 수 있습니다.In addition, starting with Windows 10, name
can be any valid BCP-47 language tag.
문화권 세 가지 집합으로 그룹화 됩니다: 고정 문화권, 중립 문화권 인 및 특정 문화권입니다.Cultures are grouped into three sets: the invariant culture, the neutral cultures, and the specific cultures. 자세한 내용은 참조에 대 한 설명을 CultureInfo 클래스입니다.For more information, see the description of the CultureInfo class.
이 메서드가 만드는 경우이 메서드에서 반환 된 특정 문화권의 문화권 식별자는 현재 Windows 문화권의 문화권 식별자와 일치 하는 CultureInfo Windows 문화권을 사용 하는 개체를 재정의 합니다.If the culture identifier of the specific culture returned by this method matches the culture identifier of the current Windows culture, this method creates a CultureInfo object that uses the Windows culture overrides. 재정의의 속성에 대 한 사용자 설정을 포함 합니다 DateTimeFormatInfo 에서 반환 된 개체를 DateTimeFormat 속성 및 NumberFormatInfo 에서 반환 된 개체는 NumberFormat 속성입니다.The overrides include user settings for the properties of the DateTimeFormatInfo object returned by the DateTimeFormat property and the NumberFormatInfo object returned by the NumberFormat property. 인스턴스화하는 CultureInfo 개체는 기본 culture 설정이 사용자 재정의 하지 않고 호출 합니다 CultureInfo(String, Boolean) 값을 사용 하 여 생성자 false
에 대 한는 useUserOverride
인수.To instantiate a CultureInfo object that with default culture settings rather than user overrides, call the CultureInfo(String, Boolean) constructor with a value of false
for the useUserOverride
argument.
하지만 CreateSpecificCulture "관련" 라는 용어를 포함 하는 메서드 이름, 버전 간에 또는 사용자 지정 문화권 또는 사용자 재정의 때문에 culture 데이터를 변경할 수 있습니다.Although the CreateSpecificCulture method name includes the term "Specific", remember that culture data can change between versions, or due to custom cultures, or because of user overrides. 데이터를 저장 하기 위한 고정 문화권 또는 이진 또는 고정 forms를 사용 합니다.Use the invariant culture or binary or fixed forms for saving data.
호출자 참고
합니다 .NET Framework 3.5.NET Framework 3.5 이전 버전에서 throw 하 고는 ArgumentException 경우 name
유효한 문화권 이름이 아닙니다.The .NET Framework 3.5.NET Framework 3.5 and earlier versions throw an ArgumentException if name
is not a valid culture name. 부터 합니다 .NET Framework 4.NET Framework 4,이 메서드는 throw를 CultureNotFoundException입니다.Starting with the .NET Framework 4.NET Framework 4, this method throws a CultureNotFoundException.