动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
  
   VBScript → 阅读文章

 VBScript GetLocale 函数

作者来源: 
阅读 数 611 人次 , 2006-4-2 23:56:00 

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> 


 本文Tags组网  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:VBScript GetObject 函数
· 下一篇:VBScript FormatPercent 函数
· VBScript 三态常数
· VBScript和JavaScript 的比较
· VBScript Private 语句
· VBScript FormatDateTime 函数
· 在 VB Script 中使用对象


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077