using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Collections;
using System.Globalization;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Threading;
namespace e1
{
class Program
{
static void Main(string[] args)
{
CultureInfo userCulture = Thread.CurrentThread.CurrentCulture;
Console.WriteLine(userCulture.Name);
Console.WriteLine(userCulture.LCID);
Console.WriteLine(userCulture.NativeName);
Console.WriteLine(userCulture.DisplayName);
Console.WriteLine(userCulture.TwoLetterISOLanguageName);
Console.WriteLine((100000).ToString("c"));
CultureInfo usCulture = Thread.CurrentThread.CurrentUICulture;
Console.WriteLine(usCulture.Name);
Console.WriteLine(usCulture.DisplayName);
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Collections;
using System.Globalization;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Threading;
namespace e1
{
class Program
{
static void Main(string[] args)
{
CultureInfo userCulture = Thread.CurrentThread.CurrentCulture;
Console.WriteLine(userCulture.Name);
Console.WriteLine(userCulture.LCID);
Console.WriteLine(userCulture.NativeName);
Console.WriteLine(userCulture.DisplayName);
Console.WriteLine(userCulture.TwoLetterISOLanguageName);
Console.WriteLine((100000).ToString("c"));
CultureInfo usCulture = Thread.CurrentThread.CurrentUICulture;
Console.WriteLine(usCulture.Name);
Console.WriteLine(usCulture.DisplayName);
Console.ReadLine();
}
}
}
MSDN描述
Thread.CurrentCulture 属性
获取或设置当前线程的区域性。
Thread.CurrentUICulture 属性
获取或设置资源管理器使用的当前区域性以便在运行时查找区域性特定的资源。
当从控制面板更改设置后在第一次运行代码时,区域信息并没有改变,当第二次运行时,通过CurrentCulture 属性实例化的userCulture信息发生变化,但是通过CurrentUICulture 属性实例化的usCulture却没有发生变化
?为什么第一次运行时不会发生变化?
?为什么通过CurrentUICulture 属性实例化的usCulture却没有发生变化?