国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

用vbscript實現啟用 Caps Lock (大寫)鍵

2019-10-26 17:59:25
字體:
來源:轉載
供稿:網友
問:
嗨,Scripting Guy!I have a script where users enter some information in an Input box.The information needs to be entered in all-capital letters, so my instructions say, “Please make sure the Caps Lock key is on before entering the information.”They don't always do that, however.Is there a way to turn the Caps Lock key on and off using a script?
-- BW, Medford, OR
答:
Hey, BW.We don't know of a way to turn the Caps Lock key on and off, but we do know a way to mimic the effect of having the Caps Lock key on.After all, the whole point of the Caps Lock key is to turn everything you type into uppercase letters.For example, you might type this:
this is my sentence.
But Caps Lock will make it appear on screen like this:
THIS IS MY SENTENCE.
So how can we achieve the same affect in a script?簡單:we just use the VBScript function UCase, which switches all the letters in a string to their uppercase equivalent.For example, here's a simple two-line script that gathers information from a user and then uses the UCase function to switch all the letters to uppercase when echoing the value to the screen:
strMessage = InputBox("Please enter your message:")Wscript.Echo UCase(strMessage)
Incidentally, the above script doesn't actually change the case of the letters in the string strMessage; it just displays them in uppercase.If you really want all the letters converted to uppercase, try this script instead:
strMessage = UCase(InputBox("Please enter your message:"))Wscript.Echo strMessage
Looks crazy, but it works.
For more information about the UCase function, see theVBScript 文檔 on MSDN.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 许昌县| 静安区| 张家口市| 广宗县| 长汀县| 石林| 肇州县| 濉溪县| 黑龙江省| 岢岚县| 黔西| 龙岩市| 苗栗县| 白沙| 句容市| 安丘市| 万年县| 沈丘县| 临沂市| 长岭县| 腾冲县| 通河县| 兴业县| 柘城县| 乡宁县| 会东县| 稷山县| 扎兰屯市| 东平县| 齐齐哈尔市| 景德镇市| 陆良县| 余干县| 宁城县| 张家川| 河池市| 松溪县| 佛冈县| 类乌齐县| 年辖:市辖区| 大港区|