当前位置:网站首页>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


边栏推荐
- Summary of the process of restoring damaged data in MySQL database
- 我真傻,招了一堆只会“谷歌”的程序员!
- [day ui] affix component learning
- Open source monitoring system Prometheus
- How to efficiently analyze online log
- "Interesting" is the competitiveness of the new era
- About the hacked database
- 1、贪吃蛇游戏设计
- 我从根上解决了微信占用手机内存问题
- 105. 简易聊天室8:使用 Socket 传递图片
猜你喜欢

使用 Abp.Zero 搭建第三方登录模块(一):原理篇

go Cobra命令行工具入门

How to do research on plant endophytes? Special topic on Microbiology

LVGL库入门教程 - 颜色和图像
![[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve](/img/ec/6c6e3d878e2a05a6e7a4ca336ae134.jpg)
[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve

How stupid of me to hire a bunch of programmers who can only "Google"!

On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"

"Interesting" is the competitiveness of the new era

解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习

Internet of things? Come and see Arduino on the cloud
随机推荐
Reset the password, and the automatic login of the website saved by chrome Google browser is lost. What is the underlying reason?
Interesting erasure code
华为AppLinking中统一链接的创建和使用
Brief introduction to cluster analysis
手机开户后多久才能通过?在线开户安全么?
Who said that "programmers are useless without computers? The big brother around me disagrees! It's true
mLife Forum | 微生物组和数据挖掘
Use txvideoeditor to add watermark and export video card at 99%? No successful failed callback?
关于被黑数据库那些事
Attack Science: ARP attack
钉钉、飞书、企业微信:迥异的商业门道
面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
[log service CLS] Tencent cloud log service CLS accesses CDN
短信服務sms
"Interesting" is the competitiveness of the new era
105. 简易聊天室8:使用 Socket 传递图片
1、贪吃蛇游戏设计
The text to voice function is available online. You can experience the services of professional broadcasters. We sincerely invite you to try it out
How can ffmpeg streaming to the server save video as a file through easydss video platform?
How stupid of me to hire a bunch of programmers who can only "Google"!