VBS教程:函数-GetLocale 函数

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了VBS教程:函数-GetLocale 函数脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

GetLocale 函数

返回当前区域设置 ID 值。

GetLocale()

说明

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

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

下面举例说明 GetLocale 函数的用法。要使用该代码,请复制标准HTML 文件中 <BODY&amp;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_&#111nclick  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> 

脚本宝典总结

以上是脚本宝典为你收集整理的VBS教程:函数-GetLocale 函数全部内容,希望文章能够帮你解决VBS教程:函数-GetLocale 函数所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: