首页 新闻 赞助 找找看

C#如何判断操作系统语言版本

0
悬赏园豆:15 [已解决问题] 解决于 2010-06-06 19:09

请问如何用C#判断操作系统是简体、繁体、英文?

龍在江湖的主页 龍在江湖 | 初学一级 | 园豆:13
提问于:2010-06-06 17:48
< >
分享
最佳答案
0

System.Globalization.CultureInfo.InstalledUICulture.Name 

System.Globalization.CultureInfo.InstalledUICulture.NativeName

对照表:
ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemglobalizationcultureinfoclasstopic.htm

收获园豆:5
Astar | 高人七级 |园豆:40805 | 2010-06-06 18:22
其他回答(1)
0

using System.Runtime.InteropServices;
static void Main(string[] args)
{
System.Console.WriteLine(System.Environment.OSVersion);
System.Console.WriteLine(System.Threading.Thread.CurrentThread.CurrentCulture.ThreeLetterWindowsLanguageName);
System.Console.WriteLine(System.Threading.Thread.CurrentThread.CurrentCulture.NativeName);
System.Console.WriteLine(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
System.Console.WriteLine(System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName);

Console.ReadKey();
}

 

Microsoft Windows NT 5.2.3790 Service Pack 2
CHS
中文(中华人民共和国)
zh-CN
Chinese (Simplified, PRC)

收获园豆:10
邀月 | 园豆:25475 (高人七级) | 2010-06-06 18:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册