您的位置:程序门 -> vb ->



vb中如何获取当前windows操作系统的语言种类?如简体、繁体或英文


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


vb中如何获取当前windows操作系统的语言种类?如简体、繁体或英文[已结贴,结贴人:tqqonline]
发表于:2007-06-26 11:06:00 楼主
如题。
请教方法,在线等中。
发表于:2007-06-26 11:53:231楼 得分:15
private   declare   function   getsystemdefaultlcid   lib   "kernel32 "   ()   as   long

private   function   getoslcid()   as   integer
dim   syslcid   as   long

syslcid   =   getsystemdefaultlcid
    '&h409(us-英文)&h809(gb-英文)     &hc09(au-英文)   &h1009(ca-英文)
    '&h004(zh-中文)&h404(tw-big5)&h804(cn-gbk/gb)&hc04(hk-big5)   &h1004(sg-gbk)
    '&h804=2052   &h404=1028   &h409=1033   &h809=2057
if   syslcid   =   &h804   or   syslcid   =   &h4   or   syslcid   =   &h1004   then
      getoslcid   =   1   '中文简体
elseif   syslcid   =   &h404   or   syslcid   =   &hc04   then
      getoslcid   =   2   '中文繁体
elseif   syslcid   mod   16   =   9   then
      getoslcid   =   0   '(英文)
else:   getoslcid   =   0
end   if

end   function
发表于:2007-06-26 12:05:092楼 得分:5
说明:
getsystemdefaultlcid   api将返回windows的non-unicode设定。strconv的最后一个参数有可能用到。

例如:
locale_ilanguage:   0804
locale_slanguage:   chinese   (prc)
locale_senglanguage:   chinese
locale_sabbrevlangname:   chs
locale_snativelangname:   中文(简体)
locale_icountry:   86
locale_scountry:   people 's   republic   of   china
locale_sengcountry:   people 's   republic   of   china
locale_sabbrevctryname:   chn
locale_snativectryname:   中华人民共和国
locale_idefaultlanguage:   0804
locale_idefaultcountry:   86
locale_idefaultcodepage:   936


快速检索

最新资讯
热门点击