CultureInfo.CurrentCulture 屬性

定義

取得或設定 CultureInfo 物件,這個物件代表目前執行緒使用的文化特性。Gets or sets the CultureInfo object that represents the culture used by the current thread.

public:
 static property System::Globalization::CultureInfo ^ CurrentCulture { System::Globalization::CultureInfo ^ get(); void set(System::Globalization::CultureInfo ^ value); };
public:
 static property System::Globalization::CultureInfo ^ CurrentCulture { System::Globalization::CultureInfo ^ get(); };
public static System.Globalization.CultureInfo CurrentCulture { get; set; }
public static System.Globalization.CultureInfo CurrentCulture { get; }
member this.CurrentCulture : System.Globalization.CultureInfo with get, set
member this.CurrentCulture : System.Globalization.CultureInfo
Public Shared Property CurrentCulture As CultureInfo
Public Shared ReadOnly Property CurrentCulture As CultureInfo

屬性值

CultureInfo

物件,代表目前執行緒使用的文化特性。An object that represents the culture used by the current thread.

例外狀況

該屬性設定為 nullThe property is set to null.

範例

下列範例示範如何變更 CurrentCulture 目前線程的和 CurrentUICultureThe following example demonstrates how to change the CurrentCulture and CurrentUICulture of the current thread.

using namespace System;
using namespace System::Globalization;
using namespace System::Threading;

int main()
{
   // Display the name of the current thread culture.
   Console::WriteLine("CurrentCulture is {0}.", CultureInfo::CurrentCulture->Name);
   
   // Change the current culture to th-TH.
   CultureInfo::CurrentCulture = gcnew CultureInfo("th-TH",false);
   Console::WriteLine("CurrentCulture is now {0}.", CultureInfo::CurrentCulture->Name);
   
   // Displays the name of the CurrentUICulture of the current thread.
   Console::WriteLine("CurrentUICulture is {0}.", CultureInfo::CurrentCulture->Name);
   
   // Changes the CurrentUICulture of the current thread to ja-JP.
   CultureInfo::CurrentUICulture = gcnew CultureInfo("ja-JP",false);
   Console::WriteLine("CurrentUICulture is now {0}.", CultureInfo::CurrentCulture->Name);
}
// The example displays the following output:
//       CurrentCulture is en-US.
//       CurrentCulture is now th-TH.
//       CurrentUICulture is en-US.
//       CurrentUICulture is now ja-JP.
using System;
using System.Globalization;
using System.Threading;

public class Example
{
   public static void Main()
   {
      // Display the name of the current thread culture.
      Console.WriteLine("CurrentCulture is {0}.", CultureInfo.CurrentCulture.Name);

      // Change the current culture to th-TH.
      CultureInfo.CurrentCulture = new CultureInfo("th-TH", false);
      Console.WriteLine("CurrentCulture is now {0}.", CultureInfo.CurrentCulture.Name);

      // Display the name of the current UI culture.
      Console.WriteLine("CurrentUICulture is {0}.", CultureInfo.CurrentUICulture.Name);

      // Change the current UI culture to ja-JP.
      CultureInfo.CurrentUICulture = new CultureInfo( "ja-JP", false );
      Console.WriteLine("CurrentUICulture is now {0}.", CultureInfo.CurrentUICulture.Name);
   }
}
// The example displays the following output:
//       CurrentCulture is en-US.
//       CurrentCulture is now th-TH.
//       CurrentUICulture is en-US.
//       CurrentUICulture is now ja-JP.
Imports System.Globalization
Imports System.Threading

Public Module Example
   Public Sub Main()

      ' Display the name of the current thread culture.
      Console.WriteLine("CurrentCulture is {0}.", CultureInfo.CurrentCulture.Name)

      ' Change the current culture to th-TH.
      CultureInfo.CurrentCulture = New CultureInfo("th-TH", False)
      Console.WriteLine("CurrentCulture is now {0}.", CultureInfo.CurrentCulture.Name)

      ' Display the name of the current UI culture.
      Console.WriteLine("CurrentUICulture is {0}.", CultureInfo.CurrentUICulture.Name)

      ' Change the current UI culture to ja-JP.
      CultureInfo.CurrentUICulture = New CultureInfo("ja-JP", False)
      Console.WriteLine("CurrentUICulture is now {0}.", CultureInfo.CurrentUICulture.Name)
   End Sub 
End Module
' The example displays the following output:
'       CurrentCulture is en-US.
'       CurrentCulture is now th-TH.
'       CurrentUICulture is en-US.
'       CurrentUICulture is now ja-JP.

備註

CultureInfo這個屬性所傳回的物件與其相關聯的物件,會決定日期、時間、數位、貨幣值、文字排序次序、大小寫慣例和字串比較的預設格式。The CultureInfo object that is returned by this property and its associated objects determine the default format for dates, times, numbers, currency values, the sorting order of text, casing conventions, and string comparisons.

目前的文化特性是執行中線程的屬性。The current culture is a property of the executing thread. 抓取屬性的值 CultureInfo.CurrentCulture 是更具效能的,相當於抓取 CultureInfo 屬性所傳回的物件 Thread.CurrentThread.CurrentCultureRetrieving the value of the CultureInfo.CurrentCulture property is a more performant equivalent of retrieving the CultureInfo object returned by the Thread.CurrentThread.CurrentCulture property.

注意

在 .NET Framework 4.5.2 和更早版本中, CurrentCulture 屬性是唯讀的; 也就是說,您可以抓取屬性值,但無法設定它。In the .NET Framework 4.5.2 and earlier versions, the CurrentCulture property is read-only; that is, you can retrieve the property value, but you cannot set it. 若要變更目前的文化特性,請將 CultureInfo 代表新文化特性的物件指派給 Thread.CurrentThread.CurrentCulture 屬性。To change the current culture, you assign the CultureInfo object that represents the new culture to the Thread.CurrentThread.CurrentCulture property. 從 .NET Framework 4.6 開始, CurrentCulture 屬性為讀寫; 您可以同時設定和取出屬性的值。Starting with the .NET Framework 4.6, the CurrentCulture property is read-write; you can both set and retrieve the property's value. 如果您將屬性值設定為 CultureInfo 代表新文化特性的物件,則屬性的值也會 Thread.CurrentThread.CurrentCulture 變更。If you do set the property value to a CultureInfo object that represents a new culture, the value of the Thread.CurrentThread.CurrentCulture property also changes.

本節內容:In this section:

如何判斷線程的文化特性 How a Thread's Culture Is Determined
取得目前的文化特性 Getting the Current Culture
明確設定 CurrentCulture 屬性 Explicitly Setting the CurrentCulture Property
目前的文化特性和使用者覆寫 The Current Culture and User Overrides
文化特性和 Windows 應用程式Culture and Windows Apps

如何判斷線程的文化特性How a Thread's Culture Is Determined

啟動執行緒時,其文化特性最初會以下列方式決定:When a thread is started, its culture is initially determined as follows:

  • 藉由線上程執行所在的應用程式域中,藉由抓取屬性所指定的文化特性 DefaultThreadCurrentCulture ,如果屬性值不是,則為 nullBy retrieving the culture that is specified by the DefaultThreadCurrentCulture property in the application domain in which the thread is executing, if the property value is not null.

  • 如果執行緒是執行以工作為基礎之非同步作業的執行緒集區執行緒,而應用程式的目標是 .NET Framework 4.6 或更新版本的 .NET Framework,則其文化特性是由呼叫執行緒的文化特性所決定。If the thread is a thread pool thread that is executing a task-based asynchronous operation and the app targets the .NET Framework 4.6 or a later version of the .NET Framework, its culture is determined by the culture of the calling thread. 下列範例會將目前的文化特性變更為葡萄牙文 (巴西) 並啟動六項工作,每個工作都會顯示其執行緒識別碼、其工作識別碼,以及其目前的文化特性。The following example changes the current culture to Portuguese (Brazil) and launches six tasks, each of which displays its thread ID, its task ID, and its current culture. (和執行緒) 的每個工作都已繼承呼叫執行緒的文化特性。Each of the tasks (and the threads) has inherited the culture of the calling thread.

    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Runtime.Versioning;
    using System.Threading;
    using System.Threading.Tasks;
    
    [assembly:TargetFramework(".NETFramework,Version=v4.6")]
    
    public class Example
    {
       public static async Task Main()
       {
          var tasks = new List<Task>();
          Console.WriteLine("The current culture is {0}",
                            Thread.CurrentThread.CurrentCulture.Name);
          Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR");
          // Change the current culture to Portuguese (Brazil).
          Console.WriteLine("Current culture changed to {0}",
                            Thread.CurrentThread.CurrentCulture.Name);
          Console.WriteLine("Application thread is thread {0}",
                            Thread.CurrentThread.ManagedThreadId);
          // Launch six tasks and display their current culture.
          for (int ctr = 0; ctr <= 5; ctr++)
             tasks.Add(Task.Run( () => {
                                   Console.WriteLine("Culture of task {0} on thread {1} is {2}",
                                                     Task.CurrentId,
                                                     Thread.CurrentThread.ManagedThreadId,
                                                     Thread.CurrentThread.CurrentCulture.Name);
                                } ));
    
          await Task.WhenAll(tasks.ToArray());
       }
    }
    // The example displays output like the following:
    //     The current culture is en-US
    //     Current culture changed to pt-BR
    //     Application thread is thread 9
    //     Culture of task 2 on thread 11 is pt-BR
    //     Culture of task 1 on thread 10 is pt-BR
    //     Culture of task 3 on thread 11 is pt-BR
    //     Culture of task 5 on thread 11 is pt-BR
    //     Culture of task 6 on thread 11 is pt-BR
    //     Culture of task 4 on thread 10 is pt-BR
    
    Imports System.Collections.Generic
    Imports System.Globalization
    Imports System.Runtime.Versioning
    Imports System.Threading
    Imports System.Threading.Tasks
    
    <assembly:TargetFramework(".NETFramework,Version=v4.6")>
    
    Module Example
       Public Sub Main()
          Dim tasks As New List(Of Task)
          Console.WriteLine("The current culture is {0}", 
                            Thread.CurrentThread.CurrentCulture.Name)
          Thread.CurrentThread.CurrentCulture = New CultureInfo("pt-BR")
          ' Change the current culture to Portuguese (Brazil).
          Console.WriteLine("Current culture changed to {0}",
                            Thread.CurrentThread.CurrentCulture.Name)
          Console.WriteLine("Application thread is thread {0}",
                            Thread.CurrentThread.ManagedThreadId)
          ' Launch six tasks and display their current culture.
          For ctr As Integer = 0 to 5
             tasks.Add(Task.Run(Sub()
                                   Console.WriteLine("Culture of task {0} on thread {1} is {2}",
                                                     Task.CurrentId, 
                                                     Thread.CurrentThread.ManagedThreadId,
                                                     Thread.CurrentThread.CurrentCulture.Name)
                                End Sub))                     
          Next
          Task.WaitAll(tasks.ToArray())
       End Sub
    End Module
    ' The example displays output like the following:
    '     The current culture is en-US
    '     Current culture changed to pt-BR
    '     Application thread is thread 9
    '     Culture of task 2 on thread 11 is pt-BR
    '     Culture of task 1 on thread 10 is pt-BR
    '     Culture of task 3 on thread 11 is pt-BR
    '     Culture of task 5 on thread 11 is pt-BR
    '     Culture of task 6 on thread 11 is pt-BR
    '     Culture of task 4 on thread 10 is pt-BR
    

    如需詳細資訊,請參閱主題中的「文化特性和以工作為基礎的非同步作業」一節 CultureInfoFor more information, see the "Culture and task-based asynchronous operations" section in the CultureInfo topic.

  • 藉由呼叫 GetUserDefaultLocaleName Windows 上的函式或 uloc_getDefault 來自 ICU的函式,而此函式目前會 setlocale LC_MESSAGES 在類似 Unix 的系統上使用類別來呼叫 POSIX 函數。By calling the GetUserDefaultLocaleName function on Windows or the uloc_getDefault function from ICU, which currently calls the POSIX setlocale function with category LC_MESSAGES, on Unix-like systems.

請注意,如果您設定的特定文化特性與系統安裝的文化特性或使用者的慣用文化特性不同,而且您的應用程式會啟動多個執行緒,則這些執行緒目前的文化特性會是函式所傳回的文化 GetUserDefaultLocaleName 特性,除非您將文化特性指派給 DefaultThreadCurrentCulture 執行緒執行所在之應用程式域中的屬性。Note that if you set a specific culture that is different from the system-installed culture or the user's preferred culture, and your application starts multiple threads, the current culture of those threads will be the culture that is returned by the GetUserDefaultLocaleName function, unless you assign a culture to the DefaultThreadCurrentCulture property in the application domain in which the thread is executing.

如需如何判斷線程文化特性的詳細資訊,請參閱參考頁面中的「文化特性和執行緒」一節 CultureInfoFor more information about how the culture of a thread is determined, see the "Culture and threads" section in the CultureInfo reference page.

取得目前的文化特性Getting the Current Culture

CultureInfo.CurrentCulture屬性是每個執行緒的設定; 也就是說,每個執行緒都可以有自己的文化特性。The CultureInfo.CurrentCulture property is a per-thread setting; that is, each thread can have its own culture. 您可以藉由取出屬性的值來取得目前線程的文化 CultureInfo.CurrentCulture 特性,如下列範例所示。You get the culture of the current thread by retrieving the value of the CultureInfo.CurrentCulture property, as the following example illustrates.

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      CultureInfo culture = CultureInfo.CurrentCulture;
      Console.WriteLine("The current culture is {0} [{1}]",
                        culture.NativeName, culture.Name);
   }
}
// The example displays output like the following:
//       The current culture is English (United States) [en-US]
Imports System.Globalization

Module Example
   Public Sub Main()
      Dim culture As CultureInfo = CultureInfo.CurrentCulture
      Console.WriteLine("The current culture is {0} [{1}]",
                        culture.NativeName, culture.Name)
   End Sub
End Module
' The example displays output like the following:
'     The current culture is English (United States) [en-US]

您也可以從屬性取出目前線程的文化 Thread.CurrentThread 特性值。You can also retrieve the value of the current thread's culture from the Thread.CurrentThread property.

明確設定 CurrentCulture 屬性Explicitly Setting the CurrentCulture Property

使用 .NET Framework 4.6 開始,若要變更現有線程所使用的文化特性,請將 CultureInfo.CurrentCulture 屬性設定為新的文化特性。Staring with the .NET Framework 4.6, to change the culture that is used by an existing thread, you set the CultureInfo.CurrentCulture property to the new culture. 如果您以這種方式明確變更執行緒的文化特性,當執行緒跨越應用程式域界限時,該變更會持續存在。If you explicitly change a thread's culture in this way, that change persists if the thread crosses application domain boundaries. 下列範例會將目前的執行緒文化特性變更為荷蘭文 (荷蘭) 。The following example changes the current thread culture to Dutch (Netherlands). 它也會顯示當目前的執行緒跨越應用程式域界限時,其目前的文化特性仍會變更。It also shows that, when the current thread crosses application domain boundaries, its current culture remains changed.

using System;
using System.Globalization;
using System.Threading;

public class Info : MarshalByRefObject
{
   public void ShowCurrentCulture()
   {
      Console.WriteLine("Culture of {0} in application domain {1}: {2}",
                        Thread.CurrentThread.Name,
                        AppDomain.CurrentDomain.FriendlyName,
                        CultureInfo.CurrentCulture.Name);
   }
}

public class Example
{
   public static void Main()
   {
      Info inf = new Info();
      // Set the current culture to Dutch (Netherlands).
      Thread.CurrentThread.Name = "MainThread";
      CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL");
      inf.ShowCurrentCulture();

      // Create a new application domain.
       AppDomain ad = AppDomain.CreateDomain("Domain2");
       Info inf2 = (Info) ad.CreateInstanceAndUnwrap(typeof(Info).Assembly.FullName, "Info");
       inf2.ShowCurrentCulture();
   }
}
// The example displays the following output:
//       Culture of MainThread in application domain ChangeCulture1.exe: nl-NL
//       Culture of MainThread in application domain Domain2: nl-NL
Imports System.Globalization
Imports System.Threading

Public Class Info : Inherits MarshalByRefObject
   Public Sub ShowCurrentCulture()
      Console.WriteLine("Culture of {0} in application domain {1}: {2}",
                        Thread.CurrentThread.Name,
                        AppDomain.CurrentDomain.FriendlyName,
                        CultureInfo.CurrentCulture.Name)
   End Sub
End Class

Module Example
   Public Sub Main()
      Dim inf As New Info()
      ' Set the current culture to Dutch (Netherlands).
      Thread.CurrentThread.Name = "MainThread"
      CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL")
      inf.ShowCurrentCulture()
      
      ' Create a new application domain.
       Dim ad As AppDomain = AppDomain.CreateDomain("Domain2")
       Dim inf2 As Info = CType(ad.CreateInstanceAndUnwrap(GetType(Info).Assembly.FullName, "Info"),
                          Info)  
       inf2.ShowCurrentCulture()                       
   End Sub
End Module
' This example displays the following output:
'       Culture of MainThread in application domain Example.exe: nl-NL
'       Culture of MainThread in application domain Domain2: nl-NL

注意

使用屬性變更文化 CultureInfo.CurrentCulture 特性需要 SecurityPermission 具有 ControlThread 設定值的許可權。Changing the culture by using the CultureInfo.CurrentCulture property requires a SecurityPermission permission with the ControlThread value set. 由於與執行緒相關聯的安全性狀態,操作執行緒是危險的。Manipulating threads is dangerous because of the security state associated with threads. 因此,此許可權只應提供給值得信賴的程式碼,並且只在必要時才提供。Therefore, this permission should be given only to trustworthy code, and then only as necessary. 您無法變更半信任程式碼中的執行緒文化特性。You cannot change thread culture in semi-trusted code.

從 .NET Framework 4 開始,您可以明確地將目前的執行緒文化特性變更為特定文化特性 (例如法文 (加拿大) ) 或中性文化特性 (例如法文) 。Starting with the .NET Framework 4, you can explicitly change the current thread culture to either a specific culture (such as French (Canada)) or a neutral culture (such as French). CultureInfo 物件代表中性文化特性時,屬性的值( CultureInfo 例如、、、和) Calendar CompareInfo DateTimeFormat NumberFormat TextInfo 會反映與中性文化特性相關聯的特定文化特性。When a CultureInfo object represents a neutral culture, the values of CultureInfo properties such as Calendar, CompareInfo, DateTimeFormat, NumberFormat, and TextInfo reflect the specific culture that is associated with the neutral culture. 例如,英文中立文化特性的主要文化特性是英文 (美國) ;德國文化的主要文化特性是德文 (德國) 。For example, the dominant culture for the English neutral culture is English (United States); the dominant culture for the German culture is German (Germany). 下列範例說明當目前的文化特性設定為特定文化特性、法文 (加拿大) 和中性文化特性(法文)時的格式設定差異。The following example illustrates the difference in formatting when the current culture is set to a specific culture, French (Canada), and a neutral culture, French.

using System;
using System.Globalization;
using System.Threading;

public class Example
{
   public static void Main()
   {
      double value = 1634.92;
      CultureInfo.CurrentCulture = new CultureInfo("fr-CA");
      Console.WriteLine("Current Culture: {0}",
                        CultureInfo.CurrentCulture.Name);
      Console.WriteLine("{0:C2}\n", value);

      Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
      Console.WriteLine("Current Culture: {0}",
                        CultureInfo.CurrentCulture.Name);
      Console.WriteLine("{0:C2}", value);
   }
}
// The example displays the following output:
//       Current Culture: fr-CA
//       1 634,92 $
//
//       Current Culture: fr
//       1 634,92 €
Imports System.Globalization
Imports System.Threading

Module Example
   Public Sub Main()
      Dim value As Double = 1634.92
      CultureInfo.CurrentCulture = New CultureInfo("fr-CA")
      Console.WriteLine("Current Culture: {0}", 
                        CultureInfo.CurrentCulture.Name)
      Console.WriteLine("{0:C2}", value)
      Console.WriteLine()
      
      Thread.CurrentThread.CurrentCulture = New CultureInfo("fr")
      Console.WriteLine("Current Culture: {0}", 
                        CultureInfo.CurrentCulture.Name)
      Console.WriteLine("{0:C2}", value)
   End Sub
End Module
' The example displays the following output:
'       Current Culture: fr-CA
'       1 634,92 $
'       
'       Current Culture: fr
'       1 634,92 €

您也可以 CultureInfo.CurrentCulture 搭配屬性使用屬性 HttpRequest.UserLanguages CurrentCulture ,將 ASP.NET 應用程式的屬性設定為使用者的慣用文化特性,如下列範例所示。You can also use the CultureInfo.CurrentCulture property along with the HttpRequest.UserLanguages property to set the CurrentCulture property of an ASP.NET application to the user's preferred culture, as the following example illustrates.

CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))

目前的文化特性和使用者覆寫The Current Culture and User Overrides

Windows 可讓使用者 CultureInfo 使用主控台中的 [ 地區及語言選項 ] 來覆寫物件的標準屬性值和其相關聯的物件。Windows allows users to override the standard property values of the CultureInfo object and its associated objects by using Regional and Language Options in Control Panel. CultureInfo屬性傳回的物件會 CurrentCulture 在下列情況下反映這些使用者覆寫:The CultureInfo object returned by the CurrentCulture property reflects these user overrides in the following cases:

  • 如果目前的執行緒文化特性是由 Windows 函數隱含設定 GetUserDefaultLocaleNameIf the current thread culture is set implicitly by the Windows GetUserDefaultLocaleName function.

  • 如果屬性所定義的目前線程文化 DefaultThreadCurrentCulture 特性對應到目前的 Windows 系統文化特性,則為。If the current thread culture defined by the DefaultThreadCurrentCulture property corresponds to the current Windows system culture.

  • 如果目前的執行緒文化特性已明確設定為方法所傳回的文化特性 CreateSpecificCulture ,且該文化特性對應到目前的 Windows 系統文化特性。If the current thread culture is set explicitly to a culture returned by the CreateSpecificCulture method, and that culture corresponds to the current Windows system culture.

  • 如果目前的執行緒文化特性設定為由函式具現化的文化特性 CultureInfo(String) ,且該文化特性對應到目前的 Windows 系統文化特性,則為。If the current thread culture is set explicitly to a culture instantiated by the CultureInfo(String) constructor, and that culture corresponds to the current Windows system culture.

在某些情況下(特別是針對伺服器應用程式),將目前的文化特性設定為 CultureInfo 反映使用者覆寫的物件可能是不必要的。In some cases, particularly for server applications, setting the current culture to a CultureInfo object that reflects user overrides may be undesirable. 相反地,您可以將目前的執行緒文化特性設定為 CultureInfo 不會以下列方式反映使用者覆寫的物件:Instead, you can set the current thread culture to a CultureInfo object that does not reflect user overrides in the following ways:

目前的文化特性和 UWP 應用程式The current culture and UWP apps

在通用 Windows 平臺 (UWP) 應用程式中, CurrentCulture 屬性為讀寫,就像是在 .NET Framework 和 .Net Core 應用程式中一樣,您可以使用它來取得和設定目前的文化特性。In Universal Windows Platform (UWP) apps, the CurrentCulture property is read-write, just as it is in .NET Framework and .NET Core apps; you can use it both to get and to set the current culture. 不過,UWP 應用程式不會區分目前的文化特性與目前的 UI 文化特性。However, UWP apps do not distinguish between the current culture and the current UI culture. CurrentCultureCurrentUICulture 屬性會對應到 ApplicationModel 中的第一個值。 DefaultCoNtext 語言集合中的第一個值。The CurrentCulture and CurrentUICulture properties map to the first value in the Windows.ApplicationModel.Resources.Core.ResourceManager.DefaultContext.Languages collection.

在 .NET Framework 和 .NET Core 應用程式中,目前的文化特性是每個執行緒的設定,而 CurrentCulture 屬性僅反映目前線程的文化特性。In .NET Framework and .NET Core apps, the current culture is a per-thread setting, and the CurrentCulture property reflects the culture of the current thread only. 在 UWP 應用程式中,目前的文化特性會對應至 ApplicationModel 的 DefaultCoNtext 語言 屬性,它是全域設定。In UWP apps, the current culture maps to the Windows.ApplicationModel.Resources.Core.ResourceManager.DefaultContext.Languages property, which is a global setting. 設定 CurrentCulture 屬性會變更整個應用程式的文化特性; 文化特性無法針對個別執行緒來設定。Setting the CurrentCulture property changes the culture of the entire app; culture cannot be set on a per-thread basis.

適用於

另請參閱