CultureInfo.CreateSpecificCulture(String) Metodo

Definizione

Crea un oggetto CultureInfo che rappresenta le impostazioni cultura specifiche associate al nome specificato.

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

Parametri

name
String

Nome predefinito di CultureInfo o nome di un oggetto CultureInfo esistente. Per name non viene effettuata la distinzione tra maiuscole e minuscole.

Restituisce

CultureInfo

Oggetto CultureInfo che rappresenta:

Impostazioni cultura invarianti, se name è una stringa vuota ("").

-oppure-

Impostazioni cultura specifiche associate a name, se name rappresenta impostazioni cultura non associate ad alcun paese.

-oppure-

Impostazioni cultura specificate da name, se name rappresenta già impostazioni cultura specifiche.

Eccezioni

name non è un nome di impostazioni cultura valido.

-oppure-

Alle impostazioni cultura specificate da name non sono associate impostazioni cultura specifiche.

name è null.

Esempio

Nell'esempio seguente viene recuperata una matrice di oggetti che rappresentano impostazioni cultura non indipendenti CultureInfo dal metodo e viene GetCultures ordinata la matrice. Quando esegue l'iterazione degli elementi nella matrice, passa il nome di ogni impostazione cultura neutra al metodo e visualizza il nome delle impostazioni cultura specifiche restituite CreateSpecificCulture dal metodo .

Nota

Nell'esempio vengono utilizzati i zh-CHS nomi delle impostazioni cultura e zh-CHT . Tuttavia, le applicazioni che Windows Vista e versioni successive devono usare invece zh-Hans di e invece di zh-CHS zh-Hant zh-CHT. zh-Hans e rappresentano lo standard corrente e devono essere usati a meno zh-Hant che non si abbia un motivo per usare i nomi meno recenti.

Si noti anche che i risultati dell'esempio possono essere diversi in un'installazione di taiwanese Windows, in cui l'input di impostazioni cultura non indipendenti dal cinese (tradizionale) (zh, zh-CHT o zh-Hant) restituirà 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

Commenti

Il CreateSpecificCulture metodo esegue il wrapping di una chiamata al costruttore CultureInfo(String) .

Nota

Per un elenco di nomi di impostazioni cultura predefiniti nei sistemi Windows, vedere la colonna Tag lingua nell'elenco dei nomi di lingua/areageografica supportati da Windows . I nomi delle impostazioni cultura seguono lo standard definito da BCP 47. Inoltre, a partire da Windows 10, può essere qualsiasi tag di lingua name BCP-47 valido.

Le impostazioni cultura sono raggruppate in tre set: impostazioni cultura invarianti, impostazioni cultura non specifiche e impostazioni cultura specifiche. Per altre informazioni, vedere la descrizione della CultureInfo classe .

Se l'identificatore delle impostazioni cultura specifiche restituite da questo metodo corrisponde all'identificatore delle impostazioni cultura Windows correnti, questo metodo crea un oggetto che usa gli override delle impostazioni cultura CultureInfo Windows impostazioni cultura. Gli override includono le impostazioni utente per le proprietà DateTimeFormatInfo dell'oggetto restituito dalla DateTimeFormat proprietà e NumberFormatInfo l'oggetto restituito dalla proprietà NumberFormat . Per creare un'istanza di un oggetto con impostazioni cultura predefinite anziché override dell'utente, chiamare il costruttore CultureInfo con un valore per CultureInfo(String, Boolean) false useUserOverride l'argomento .

Anche se il nome del metodo include il termine "Specifico", tenere presente che i dati delle impostazioni cultura possono cambiare tra le versioni o a causa di impostazioni cultura personalizzate o a causa di CreateSpecificCulture override dell'utente. Usare le impostazioni cultura invarianti o i moduli binari o fissi per il salvataggio dei dati.

Note per i chiamanti

.NET Framework 3.5 e versioni precedenti generano ArgumentException un'eccezione se name non è un nome di impostazioni cultura valido. A partire .NET Framework 4, questo metodo genera un'eccezione CultureNotFoundException .

In .NET 6 e versioni successive viene generata un'eccezione se l'app è in esecuzione in un ambiente in cui è abilitata la modalità invariante della globalizzazione, ad esempio, alcuni contenitori Docker e vengono specificate impostazioni cultura diverse dalle impostazioni cultura CultureNotFoundException invarianti.

Si applica a

Vedi anche