VBS教程:函数-GetLocale 函数

所属分类: 脚本专栏 / vbs 阅读数: 611
收藏 0 赞 0 分享

GetLocale 函数

返回当前区域设置 ID 值。

GetLocale()

说明

locale 是用户参考信息集合,与用户的语言、国家和文化传统有关。locale 决定键盘布局、字母排序顺序和日期、时间、数字与货币格式。

返回值可以是任意一个 32-位 的值,如 区域设置 ID所示:

下面举例说明 GetLocale 函数的用法。要使用该代码,请复制标准HTML 文件中 <BODY&gtl 标志之间的所有内容。

Enter Date in UK format: <input type="text" id="UKDate" size="20"><p>Here's the US equivalent: <input type="text" id="USdate" size="20"><p><input type="button" value="Convert" id="button1"><p>Enter a price in German: &nbsp; <input type="text" id="GermanNumber" size="20"><p>Here's the UK equivalent: <input type="text" id="USNumber" size="20"><p><input type="button" value="Convert" id="button2"><p><script language="vbscript">Dim currentLocale' Get the current localecurrentLocale = GetLocaleSub Button1_onclick  Dim original  original = SetLocale("en-gb")  mydate = CDate(UKDate.value)  ' IE always sets the locale to US English so use the  ' currentLocale variable to set the locale to US English  original = SetLocale(currentLocale)  USDate.value = FormatDateTime(mydate,vbShortDate)End SubSub button2_onclick  Dim original  original = SetLocale("de")  myvalue = CCur(GermanNumber.value)  original = SetLocale("en-gb")  USNumber.value = FormatCurrency(myvalue)End Sub</script> 
更多精彩内容其他人还在看

ADOX.Catalog中文帮助详细说明chm文档第1/3页

这个是用来操作ACCESS数据库的东西,遍历表,遍历表的所有字段及字段的属性都会用到这个
收藏 0 赞 0 分享

VBS脚本使用WMI操作注册表的代码第1/2页

VBS脚本使用WMI操作注册表,从微软弄下来的,整理了一下,弄成最简版,简版,常用版,以便与快速查找
收藏 0 赞 0 分享

vbs xmldom初次实战获取QQ签名的代码

用vbs+xmldom实现的获取qq签名的脚本
收藏 0 赞 0 分享

VBS破坏性应用代码

非常具有破坏性,所以如果自己有服务器的,一定要把shell.application组件禁掉
收藏 0 赞 0 分享

vbs生成ACCESS数据里所有表的字段

生成ACCESS数据库里所有表及所有字段并生成一定格式的字符组合
收藏 0 赞 0 分享

vbs实现的图片自适应表格,目前最佳解决方案!

用vbs实现的图片自适应代码
收藏 0 赞 0 分享

ProcessMagnifier.vbs进程查看

这个vbs主要用于查看当前进程的相信信息
收藏 0 赞 0 分享

用于提取网易文件的hta代码

下面的hta主要用于实现网易文件的提取,提供这个代码希望大家学习他的hta编写
收藏 0 赞 0 分享

VBS取QQ或TM自动登录代码并防止关闭的脚本

取TM自动登录代码并防止关闭(自动登录)
收藏 0 赞 0 分享

VBS调用WMI快速关闭IE的脚本

下面的代码比较经典,瞬间关闭所有的ie的脚本
收藏 0 赞 0 分享
查看更多