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


边栏推荐
- Use abp Zero builds a third-party login module (I): Principles
- Ghost, a synonym for blog system
- ‘高并发&高性能&高可用服务程序’编写及运维指南
- The programmer's graduation project is still bald after a year
- Sms service sms
- 16 safety suggestions from metamask project to solid programmers
- How to make secruecrt more productive
- 我開導一個朋友的一些話以及我個人對《六祖壇經》的一點感悟
- Boss direct employment IPO: both the end and the beginning
- Codereview tool chain for micro medicine
猜你喜欢

1. Snake game design

Parse NC format file and GRB format file dependent package edu ucar. API learning of netcdfall

Getting started with the lvgl Library - colors and images

一文理解OpenStack网络

Concept + formula (excluding parameter estimation)

Brief introduction to cluster analysis

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

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

关于被黑数据库那些事

Internet of things? Come and see Arduino on the cloud
随机推荐
解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习
强化学习之父Richard Sutton论文:追寻智能决策者的通用模型
我開導一個朋友的一些話以及我個人對《六祖壇經》的一點感悟
WPF从零到1教程详解,适合新手上路
钉钉、飞书、企业微信:迥异的商业门道
Detailed explanation of abstractqueuedsynchronizer, the cornerstone of thread synchronization
天猫618农产品“百强县” 35个县域来自中西部及东北
Summary of the process of restoring damaged data in MySQL database
How stupid of me to hire a bunch of programmers who can only "Google"!
The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
Ask a question about SQL view
短信服务sms
Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)
Kubernetes practical skill: entering container netns
Use the open source tool k8tz to gracefully set the kubernetes pod time zone
几种常见的DoS攻击
从《梦华录》的争议性,谈谈数字版权作品的价值泡沫
Creation and use of unified links in Huawei applinking
From theory to practice, decipher Alibaba's internal MySQL optimization scheme in simple terms
Redis' contribution in the field of microservices