VBS教程:函數(shù)-GetLocale 函數(shù)
GetLocale 函數(shù)
返回當(dāng)前區(qū)域設(shè)置 ID 值。
GetLocale()
說明
locale 是用戶參考信息集合,與用戶的語言、國家和文化傳統(tǒng)有關(guān)。locale 決定鍵盤布局、字母排序順序和日期、時(shí)間、數(shù)字與貨幣格式。
返回值可以是任意一個(gè) 32-位 的值,如 區(qū)域設(shè)置 ID所示:
下面舉例說明 GetLocale 函數(shù)的用法。要使用該代碼,請復(fù)制標(biāo)準(zhǔn)HTML 文件中 <BODY>l 標(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>
相關(guān)文章
vbs判斷磁盤類型和檢測硬盤剩余空間的實(shí)現(xiàn)代碼
這篇文章主要介紹了vbs判斷磁盤類型和檢測硬盤剩余空間的實(shí)現(xiàn)代碼,需要的朋友可以參考下2016-10-10自定義vbs腳本實(shí)現(xiàn)開機(jī)后延時(shí)啟動(dòng)指定程序的方法
這篇文章主要介紹了自定義vbs腳本實(shí)現(xiàn)開機(jī)后延時(shí)啟動(dòng)指定程序的方法,本文以延遲啟動(dòng)金山毒霸為例,需要的朋友可以參考下2014-09-09用vbs實(shí)現(xiàn)顯示系統(tǒng)調(diào)色板的代碼
用vbs實(shí)現(xiàn)顯示系統(tǒng)調(diào)色板的代碼...2007-10-10通過vbs修改以點(diǎn)結(jié)尾的文件的屬性為隱藏
這篇文章主要介紹了通過vbs修改以點(diǎn)結(jié)尾的文件的屬性為隱藏,需要的朋友可以參考下2016-12-12