收藏 分享(赏)

C#:获取系统环境语言.pdf

上传人:weiwoduzun 文档编号:5631836 上传时间:2019-03-10 格式:PDF 页数:8 大小:249.34KB
下载 相关 举报
C#:获取系统环境语言.pdf_第1页
第1页 / 共8页
C#:获取系统环境语言.pdf_第2页
第2页 / 共8页
C#:获取系统环境语言.pdf_第3页
第3页 / 共8页
C#:获取系统环境语言.pdf_第4页
第4页 / 共8页
C#:获取系统环境语言.pdf_第5页
第5页 / 共8页
点击查看更多>>
资源描述

1、C#:获取系统环境语言using System;using System.Runtime.InteropServices;namespace Splash public class Environment DllImport(“kernel3 2 .dll“)private static extern UInt1 6 GetUserDefaultUILanguage();DllImport(“kernel3 2 .dll“)private static extern UInt1 6 GetSystemDefaultLangID();DllImport(“kernel3 2 .dll“)priv

2、ate static extern UInt1 6 GetUserDefaultLangID();/ /用户缺省界面语言/ public static UInt1 6 UserDefaultUILanguage getreturn GetUserDefaultUILanguage();/ /用户缺省语言/ public static UInt1 6 UserDefaultLangID get return GetUserDefaultLangID();/ /系统缺省语言/ public static UInt1 6 SystemDefaultLangID get return GetSyste

3、mDefaultLangID();GetSystemDefaultLangID该函数获取的语言是控制面板区域与语言选项高级tab页中设置的支持的非Unicode语言,即如下图所示:GetUserDefaultLangID,该函数获取的语言是控制面板区域与语言选项区域选项tab页中设置的标准和格式语言,即如下图所示:综上所述,GetSystemDefaultLangID和GetUserDefaultLangID获取的语言,受区域语言设置中的选项影响,所以这两个函数是不能用的。我们需要获取的是操作系统本身的语言版本。GetSystemDefaultUILanguage的应用场景较单一,使用GetU

4、serDefaultUILanguage应该是最有效的。所以最终使用的是GetUserDefaultUILanguage函数。Identifier Predefined symbol Language0x00 LANG_NEUTRAL Neutral0x01 LANG_ARABIC Arabic0x02 LANG_BULGARIAN Bulgarian0x03 LANG_CATALAN Catalan0x04 LANG_CHINESE Chinese0x05 LANG_CZECH Czech0x06 LANG_DANISH Danish0x07 LANG_GERMAN German0x08 L

5、ANG_GREEK Greek0x09 LANG_ENGLISH English0x0a LANG_SPANISH Spanish0x0b LANG_FINNISH Finnish0x0c LANG_FRENCH French0x0d LANG_HEBREW Hebrew0x0e LANG_HUNGARIAN Hungarian0x0f LANG_ICELANDIC Icelandic0x10 LANG_ITALIAN Italian0x11 LANG_JAPANESE Japanese0x12 LANG_KOREAN Korean0x13 LANG_DUTCH Dutch0x14 LANG_

6、NORWEGIAN Norwegian0x15 LANG_POLISH Polish0x16 LANG_PORTUGUESE Portuguese0x18 LANG_ROMANIAN Romanian0x19 LANG_RUSSIAN Russian0x1a LANG_CROATIAN Croatian0x1a LANG_SERBIAN Serbian0x1b LANG_SLOVAK Slovak0x1c LANG_ALBANIAN Albanian0x1d LANG_SWEDISH Swedish0x1e LANG_THAI Thai0x1f LANG_TURKISH Turkish0x20

7、 LANG_URDU Urdu0x21 LANG_INDONESIAN Indonesian0x22 LANG_UKRAINIAN Ukrainian0x23 LANG_BELARUSIAN Belarusian0x24 LANG_SLOVENIAN Slovenian0x25 LANG_ESTONIAN Estonian0x26 LANG_LATVIAN Latvian0x27 LANG_LITHUANIAN Lithuanian0x29 LANG_FARSI Farsi0x2a LANG_VIETNAMESE Vietnamese0x2b LANG_ARMENIAN Armenian0x2

8、c LANG_AZERI Azeri0x2d LANG_BASQUE Basque0x2f LANG_MACEDONIAN FYRO Macedonian0x36 LANG_AFRIKAANS Afrikaans0x37 LANG_GEORGIAN Georgian0x38 LANG_FAEROESE Faeroese0x39 LANG_HINDI Hindi0x3e LANG_MALAY Malay0x3f LANG_KAZAK Kazak0x40 LANG_KYRGYZ Kyrgyz0x41 LANG_SWAHILI Swahili0x43 LANG_UZBEK Uzbek0x44 LAN

9、G_TATAR Tatar0x45 LANG_BENGALI Not supported.0x46 LANG_PUNJABI Punjabi0x47 LANG_GUJARATI Gujarati0x48 LANG_ORIYA Not supported.0x49 LANG_TAMIL Tamil0x4a LANG_TELUGU Telugu0x4b LANG_KANNADA Kannada0x4c LANG_MALAYALAM Not supported.0x4d LANG_ASSAMESE Not supported.0x4e LANG_MARATHI Marathi0x4f LANG_SA

10、NSKRIT Sanskrit0x50 LANG_MONGOLIAN Mongolian0x56 LANG_GALICIAN Galician0x57 LANG_KONKANI Konkani0x58 LANG_MANIPURI Not supported.0x59 LANG_SINDHI Not supported.0x5a LANG_SYRIAC Syriac0x60 LANG_KASHMIRI Not supported.0x61 LANG_NEPALI Not supported.0x65 LANG_DIVEHI Divehi0x7f LANG_INVARIANT0x0000 Lang

11、uage Neutral0x007f The language for the invariant locale (LOCALE_INVARIANT). See MAKELCID.0x0400 Process or User Default Language0x0800 System Default Language0x0436 Afrikaans0x041c Albanian0x0401 Arabic (Saudi Arabia)0x0801 Arabic (Iraq)0x0c01 Arabic (Egypt)0x1001 Arabic (Libya)0x1401 Arabic (Alger

12、ia)0x1801 Arabic (Morocco)0x1c01 Arabic (Tunisia)0x2001 Arabic (Oman)0x2401 Arabic (Yemen)0x2801 Arabic (Syria)0x2c01 Arabic (Jordan)0x3001 Arabic (Lebanon)0x3401 Arabic (Kuwait)0x3801 Arabic (U.A.E.)0x3c01 Arabic (Bahrain)0x4001 Arabic (Qatar)0x042b Windows 2000/XP: Armenian. This is Unicode only.0

13、x042c Azeri (Latin)0x082c Azeri (Cyrillic)0x042d Basque0x0423 Belarusian0x0402 Bulgarian0x0455 Burmese0x0403 Catalan0x0404 Chinese (Taiwan)0x0804 Chinese (PRC)0x0c04 Chinese (Hong Kong SAR, PRC)0x1004 Chinese (Singapore)0x1404 Windows 98/Me, Windows 2000/XP: Chinese (Macao SAR)0x041a Croatian0x0405

14、Czech0x0406 Danish0x0465 Windows XP: Divehi. This is Unicode only.0x0413 Dutch (Netherlands)0x0813 Dutch (Belgium)0x0409 English (United States)0x0809 English (United Kingdom)0x0c09 English (Australian)0x1009 English (Canadian)0x1409 English (New Zealand)0x1809 English (Ireland)0x1c09 English (South

15、 Africa)0x2009 English (Jamaica)0x2409 English (Caribbean)0x2809 English (Belize)0x2c09 English (Trinidad)0x3009 Windows 98/Me, Windows 2000/XP: English (Zimbabwe)0x3409 Windows 98/Me, Windows 2000/XP: English (Philippines)0x0425 Estonian0x0438 Faeroese0x0429 Farsi0x040b Finnish0x040c French (Standa

16、rd)0x080c French (Belgian)0x0c0c French (Canadian)0x100c French (Switzerland)0x140c French (Luxembourg)0x180c Windows 98/Me, Windows 2000/XP: French (Monaco)0x0456 Windows XP: Galician0x0437 Windows 2000/XP: Georgian. This is Unicode only.0x0407 German (Standard)0x0807 German (Switzerland)0x0c07 Ger

17、man (Austria)0x1007 German (Luxembourg)0x1407 German (Liechtenstein)0x0408 Greek0x0447 Windows XP: Gujarati. This is Unicode only.0x040d Hebrew0x0439 Windows 2000/XP: Hindi. This is Unicode only.0x040e Hungarian0x040f Icelandic0x0421 Indonesian0x0410 Italian (Standard)0x0810 Italian (Switzerland)0x0

18、411 Japanese0x044b Windows XP: Kannada. This is Unicode only.0x0457 Windows 2000/XP: Konkani. This is Unicode only.0x0412 Korean0x0812 Windows 95, Windows NT 4.0 only: Korean (Johab)0x0440 Windows XP: Kyrgyz.0x0426 Latvian0x0427 Lithuanian0x0827 Windows 98 only: Lithuanian (Classic)0x042f FYRO Maced

19、onian0x043e Malay (Malaysian)0x083e Malay (Brunei Darussalam)0x044e Windows 2000/XP: Marathi. This is Unicode only.0x0450 Windows XP: Mongolian0x0414 Norwegian (Bokmal)0x0814 Norwegian (Nynorsk)0x0415 Polish0x0416 Portuguese (Brazil)0x0816 Portuguese (Portugal)0x0446 Windows XP: Punjabi. This is Uni

20、code only.0x0418 Romanian0x0419 Russian0x044f Windows 2000/XP: Sanskrit. This is Unicode only.0x0c1a Serbian (Cyrillic)0x081a Serbian (Latin)0x041b Slovak0x0424 Slovenian0x040a Spanish (Spain, Traditional Sort)0x080a Spanish (Mexican)0x0c0a Spanish (Spain, Modern Sort)0x100a Spanish (Guatemala)0x140

21、a Spanish (Costa Rica)0x180a Spanish (Panama)0x1c0a Spanish (Dominican Republic)0x200a Spanish (Venezuela)0x240a Spanish (Colombia)0x280a Spanish (Peru)0x2c0a Spanish (Argentina)0x300a Spanish (Ecuador)0x340a Spanish (Chile)0x380a Spanish (Uruguay)0x3c0a Spanish (Paraguay)0x400a Spanish (Bolivia)0x4

22、40a Spanish (El Salvador)0x480a Spanish (Honduras)0x4c0a Spanish (Nicaragua)0x500a Spanish (Puerto Rico)0x0430 Sutu0x0441 Swahili (Kenya)0x041d Swedish0x081d Swedish (Finland)0x045a Windows XP: Syriac. This is Unicode only.0x0449 Windows 2000/XP: Tamil. This is Unicode only.0x0444 Tatar (Tatarstan)0x044a Windows XP: Telugu. This is Unicode only.0x041e Thai0x041f Turkish0x0422 Ukrainian0x0420 Windows 98/Me, Windows 2000/XP: Urdu (Pakistan)0x0820 Urdu (India)0x0443 Uzbek (Latin)0x0843 Uzbek (Cyrillic)0x042a Windows 98/Me, Windows NT 4.0 and later: Vietnamese

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 经营企划

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报