• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >vbs > 用vbscript实现启用 Caps Lock (大写)键

用vbscript实现启用 Caps Lock (大写)键

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了capslock怎么读,capslock键是什么意思,caps lock,caps lock是什么键,caps lock是什么意思等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问:
嗨,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.
</div>

您可能想查找下面的文章:

  • 用vbscript实现启用 Caps Lock (大写)键

相关文章

  • 右键发送(sendto),创建快捷方式到自定义的位置
  • vbs字符串操作小考题
  • vbscript语句中“&amp;H”专用于16进制数表示
  • EXE2BAT(EXE转BAT)的vbs脚本
  • adodb.stream读文件到数组的代码
  • vbs搜索文件名或者得到目录列表
  • vbs Windows系统改变或修改网卡的MAC地址的脚本与软件第1/2页
  • VBS教程:函数-CStr 函数
  • 获得文件夹大小的VBS代码
  • VBS教程:函数-IsNumeric 函数

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • unpack.vbs
    • VBS 加解密 For MS Script Encode
    • 使用 iisweb.vbs 列出网站的方法
    • 利用VBS实现显示系统服务列表
    • VC中实现文字竖排的简单方法(推荐)
    • 用VBS实现一个小键盘动作CTRL+V粘贴操作与思路分析
    • 多进程的vbs脚本
    • VBS脚本加密/解密VBS脚本(简易免杀版1.1)
    • VBScript根据盘符找设备名的代码
    • 改进后的mkw3site.vbs(创建虚拟目录)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有