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

 VBScript SetLocale 函数

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

setlocale 函数

sets the global locale and returns the previous locale.

setlocale(lcid)

lcid 参数可以是任意一个合法的 32 位数值或短字符串,该值必须唯一标识一个地理区域。能被识别的值可以查阅 区域设置 id 表。

说明

lcid 为零,区域被设置为与当前系统设置匹配。

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

下面举例说明 setlocale 函数的用法。要使用该代码,请复制标准html 文件中 <body> 标志之间的所有内容。

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 Sgn 函数
· 下一篇:VBScript Second 函数
· VBScript StrReverse 函数
· VBScript GetObject 函数
· VBScript Weekday 函数
· VBScript While...Wend 语句
· VBScript Asc 函数


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