手机分类
  导航: 电脑时代在线 · 网站开发 · VBScript · VBScript基础教程
有问题吗?看 疑难解答 电脑术语

VBScript GetLocale 函数

 
硬件盘点
手机推荐
 
『VBScript GetLocale 函数』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-8-8 

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 locale

currentLocale = 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> 


 


如果您有什么疑问,可以至论坛提出或者解答他人的疑问   返回页面顶部

】【关闭窗口
·上一篇教程: 没有了
·下一篇教程:
·导航: 电脑时代在线 · 网站开发 · VBScript · VBScript基础教程
相关文章
 
搞笑自拍|图片故事|美女图库|体坛宝贝|明星爆料|世界奇观|风光摄影|历史回忆|大千世界
Photshop超炫图片
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部  
网站文本地图
  版权所有:电脑时代在线 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2007 www.PCvz.com online services. all rights reserved. 蜀ICP备05015578
Template designed by LaoJiang. Optimized for 1024x768 to Firefox,Opera and MS-IE. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光