当前位置:网站首页>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
VBS
It's a kind ofWindows
Scripting language , The full name isMicrosoft Visual Basic Script Editon
, Microsoft Visualization BASIC Script versionvbs
It's built-in , The code can be found inwindows
Direct execution in the system , No compilation environment is required , Very convenientvbs
The script is simple , Efficient , Most functions can be realized , Make good use ofvbs
Script , 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
.txt
Change 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-5
common 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 button
And it is forbidden to click on the... In the upper right corner of the dialog boxclose
Button ;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-8
Of , howeverVBS
The script needs to be encoded inANSI
Can 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
►determine
Can 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
vbs
Throughdim
Defining variables , The grammar is :dim Variable name 1, Variable name 2, Variable name 3... Variable name n
- among
inputbox
It 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
vbs
make - Use
dim a(5)
You can define arrays ,5 Indicates how many elements are in the array - Use
Select Case
Indicates 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
边栏推荐
- What should I do if I fail to apply for the mime database? The experience from failure to success is shared with you ~
- [log service CLS] Tencent cloud log service CLS accesses CDN
- Continuous testing | key to efficient testing in Devops Era
- ‘高并发&高性能&高可用服务程序’编写及运维指南
- SCRM, a breakthrough in the new consumption era
- Boss direct employment IPO: both the end and the beginning
- MySQL foreign key impact
- How to do research on plant endophytes? Special topic on Microbiology
- 面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
- Configure Yum proxy
猜你喜欢
1、贪吃蛇游戏设计
LVGL库入门教程 - 颜色和图像
On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
【2022国赛模拟】摆(bigben)——行列式、杜教筛
‘高并发&高性能&高可用服务程序’编写及运维指南
The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
Nifi from introduction to practice (nanny level tutorial) - environment
nifi从入门到实战(保姆级教程)——环境篇
Getting started with the lvgl Library - colors and images
Getting started with the go Cobra command line tool
随机推荐
How stupid of me to hire a bunch of programmers who can only "Google"!
Are you still working hard to select *? Then put away these skills
Ask a question about SQL view
How can ffmpeg streaming to the server save video as a file through easydss video platform?
Continuous testing | key to efficient testing in Devops Era
[live broadcast of celebrities] elastic observability workshop
【数据挖掘】期末复习(样卷题目+少量知识点)
SCRM, a breakthrough in the new consumption era
天猫618农产品“百强县” 35个县域来自中西部及东北
简述聚类分析
实现领域驱动设计 - 使用ABP框架 - 更新操作实体
解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习
【数据库】期末复习(计科版)
openGauss内核:简单查询的执行
WPF from zero to 1 tutorial details, suitable for novices on the road
Boss direct employment IPO: both the end and the beginning
Another prize! Tencent Youtu won the leading scientific and technological achievement award of the 2021 digital Expo
‘高并发&高性能&高可用服务程序’编写及运维指南
Use the open source tool k8tz to gracefully set the kubernetes pod time zone
短信服务sms