我如何使用SetLocaleinfo()

本文关键字:SetLocaleinfo 何使用 | 更新日期: 2023-09-27 18:12:04

我想用c#改变操作系统的语言。那么如何在c#中使用SetLocaleinfo()函数

我如何使用SetLocaleinfo()

如果你能提供更多关于你的环境的信息(例如你使用的UI winforms/wpf/silverlight/…),那就太好了,以获得更具体的答案。

如果您使用WPF或Silverlight,请尝试:

// Put the using statements at the beginning of the code module
using System.Threading;
using System.Globalization;
// Put the following code before InitializeComponent()
// Sets the culture to French (France)
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
// Sets the UI culture to French (France)
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");