VBS教程:函數(shù)-SetLocale 函數(shù)
SetLocale 函數(shù)
Sets the global locale and returns the previous locale.
SetLocale(lcid)
lcid 參數(shù)可以是任意一個(gè)合法的 32 位數(shù)值或短字符串,該值必須唯一標(biāo)識(shí)一個(gè)地理區(qū)域。能被識(shí)別的值可以查閱 區(qū)域設(shè)置 ID 表。
說(shuō)明
若 lcid 為零,區(qū)域被設(shè)置為與當(dāng)前系統(tǒng)設(shè)置匹配。
一個(gè) locale 是用戶參考信息集合,與用戶的語(yǔ)言、國(guó)家和文化傳統(tǒng)有關(guān)。該 locale 決定鍵盤(pán)布局、字母排序順序和日期、時(shí)間、數(shù)字與貨幣格式。
下面舉例說(shuō)明 SetLocale 函數(shù)的用法。要使用該代碼,請(qǐng)復(fù)制標(biāo)準(zhǔn)HTML 文件中 <BODY> 標(biāo)志之間的所有內(nèi)容。
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: <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>
請(qǐng)參閱
相關(guān)文章
VBScript 動(dòng)態(tài) Array 的實(shí)現(xiàn)代碼
這篇文章主要介紹了VBScript 動(dòng)態(tài) Array 的實(shí)現(xiàn)代碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-04-04遠(yuǎn)程開(kāi)啟/關(guān)閉目標(biāo)telnet服務(wù)的windows腳本RTCS.vbs
遠(yuǎn)程開(kāi)啟/關(guān)閉目標(biāo)telnet服務(wù)的windows腳本RTCS.vbs...2007-02-02VBS腳本加密/解密VBS腳本(簡(jiǎn)易免殺版1.1)
由于殺軟的原因使得“加密/解密VBS腳本”版不能正常使用,于是修改了一下加密函數(shù)逃避殺軟,但同 1.0版一樣由宿主解釋執(zhí)行腳本的特性注定了這種加密是可逆并非常脆弱的,WScript.Echo 一下Execute 后的內(nèi)容即可顯示源碼了。 算法大家可任意改。。。。。2008-01-01顯示運(yùn)行對(duì)話框內(nèi)保存的命令歷史的vbs
這段代碼可以獲取曾經(jīng)在運(yùn)行對(duì)話框中的,我們之前輸入的命令歷史2008-10-10