当前位置:网站首页>Beauty of script │ VBS introduction interactive practice
Beauty of script │ VBS introduction interactive practice
2022-06-24 13:08:00 【51CTO】
Catalog
One 、 What is? VBS
VBSIt's a kind ofWindowsScripting language , The full name isMicrosoft Visual Basic Script Editon, Microsoft Visualization BASIC Script versionvbsIt's built-in , The code can be found inwindowsDirect execution in the system , No compilation environment is required , Very convenientvbsThe script is simple , Efficient , Most functions can be realized , Make good use ofvbsScript , Can greatly improve the efficiency , It can be used to do some repeated and tedious machine operations
Two 、 first VBS Script
- Create a new text document on the desktop
- Open a text document , Type in
msgbox "Hello World!" - Suffix the format of the text document
.txtChange it to.vbs - Then double click the run file

3、 ... and 、msgbox grammar
- grammar :
msgbox " Dialog content "," Dialog type ( Parameters :0,1,2,3,4,5)"," Dialog title " - Dialog content : It refers to the main content of the pop-up window
- Dialog type : You can choose
0-5common 6 Three types of dialog modes ,0 The dialog box only hasOK button;1 The dialog box hasOK button、Cancel button;2 The dialog box hasStop button、Retry button、Ignore button;3 The dialog box hasIt's a button、No button、Cancel button;4 The dialog box hasIt's a button、No buttonAnd it is forbidden to click on the... In the upper right corner of the dialog boxcloseButton ;5 The dialog box hasRetry button、Cancel button. If you don't fill in the silent opinion 0 - Dialog title : It refers to the title of the pop-up window

Four 、 Chinese garbled
- You can see the Chinese garbled code in the above figure
- This is mainly caused by coding errors , The encoding format of a normal text document is
UTF-8Of , howeverVBSThe script needs to be encoded inANSICan run Chinese normally - At this time we need
Open a text document►Click on the file in the upper left corner►Save as►Select code as ANSI►determineCan solve

5、 ... and 、 Pop up interactive function
- We just implemented a very simple display function , Then we need to implement the interactive function , Variables are needed
- stay
vbsThroughdimDefining variables , The grammar is :dim Variable name 1, Variable name 2, Variable name 3... Variable name n - among
inputboxIt can be used to receive parameters manually entered by the user


6、 ... and 、 Confession mischief
- Before the very fire can not close the confession pop-up window , Namely
vbsmake - Use
dim a(5)You can define arrays ,5 Indicates how many elements are in the array - Use
Select CaseIndicates that this is an option - The return value of the selected consent is 6, The return value of disagree is 7
- If you click disagree , Then loop through the array to show
- If the user clicks agree , Then the plot will succeed , Exit options


边栏推荐
- 一文讲透研发效能!您关心的问题都在
- A hero's note stirred up a thousand waves across 10 countries, and the first-line big factories sent people here- Gwei 2022 Singapore
- IOMMU (VII) -vfio and mdev
- Engage in audio and video development? Several things I have to say about SRT live broadcast protocol
- CVPR 2022 | interprétation de certains documents de l'équipe technique de meituan
- [highlights] summary of award-winning activities of Tencent cloud documents
- Configuration (enable_*) parameter related to execution plan in PG
- SCRM, a breakthrough in the new consumption era
- Redis' contribution in the field of microservices
- [database] final review (planning Edition)
猜你喜欢

MySQL 外键影响

On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
![[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve](/img/ec/6c6e3d878e2a05a6e7a4ca336ae134.jpg)
[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve

Getting started with the lvgl Library - colors and images

使用开源工具 k8tz 优雅设置 Kubernetes Pod 时区

Reading notes of returning to hometown

CVPR 2022 | 美團技術團隊精選論文解讀

About the hacked database

C语言中常量的定义和使用

nifi从入门到实战(保姆级教程)——环境篇
随机推荐
微医CodeReview工具链
Reading notes of returning to hometown
线程同步的基石AbstractQueuedSynchronizer详解
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
Attack popular science: DDoS
CVPR 2022 | 美團技術團隊精選論文解讀
Configuration (enable_*) parameter related to execution plan in PG
【概率论期末抱佛脚】概念+公式(不含参数估计)
The programmer's graduation project is still bald after a year
The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
IOMMU (VII) -vfio and mdev
Use txvideoeditor to add watermark and export video card at 99%? No successful failed callback?
从《梦华录》的争议性,谈谈数字版权作品的价值泡沫
go Cobra命令行工具入门
[programming navigation] the practical code summarized by foreign great God, learned in 30 seconds!
我开导一个朋友的一些话以及我个人对《六祖坛经》的一点感悟
What if the WordPress website forgets its password
What should I do if I fail to apply for the mime database? The experience from failure to success is shared with you ~
what the fuck! I'm flattered. He actually wrote down the answers to the redis interview questions that big companies often ask!
【数据库】期末复习(计科版)