国产探花免费观看_亚洲丰满少妇自慰呻吟_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.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 吴旗县| 增城市| 中阳县| 平遥县| 衡阳市| 宜都市| 唐河县| 镇坪县| 邯郸市| 康平县| 涞水县| 兴隆县| 阜平县| 沾化县| 信阳市| 盘锦市| 红河县| 方正县| 新邵县| 宜兰市| 大田县| 旬邑县| 读书| 泌阳县| 迭部县| 大洼县| 昌黎县| 潞城市| 民和| 辽中县| 泸水县| 波密县| 宁远县| 洮南市| 叶城县| 松江区| 崇阳县| 化州市| 连城县| 漯河市| 延安市|