当前位置:网站首页>Beauty of script │ VBS introduction interactive practice
Beauty of script │ VBS introduction interactive practice
2022-06-24 11:05:00 【Geek flying rabbit】
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
msgbox " Brother flying rabbit gives you a prize to receive ", 3, " Warm reminder "

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
dim name
name = inputbox(" Please tell me who you are ", " This is the title of the interaction ")
msgbox name,," Welcome "


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
MsgBox " The Buddha cries for "
MsgBox " Naihe bridge waits "
MsgBox " Look back 500 times "
MsgBox " Looking back over the millennia "
MsgBox " The reincarnation of all ages "
MsgBox " Change your present life love "
MsgBox " Would you please "
dim a(5)
a(0)=" Tian Da , Big land , Girlfriend is the biggest "
a(1)=" Pay up "
a(2)=" Write your name in the room "
a(3)=" Help clear the shopping cart "
a(4)=" Baoda "
a(5)=" Just promise me to ^o^"
Dim j
Do
Select Case msgbox (" The girl , Be my girlfriend ", 4)
Case 6
MsgBox "you are my girlfriend," + Chr(13) + "from this day until to my last days."
exit do
Case 7
msgbox a(i)
i=i+1
if i >= 6 then
i = 0
end if
end Select
Loop


边栏推荐
- splice()方法的使用介绍
- Which map navigation is easy to use and accurate?
- 【本周六活动】.NET Day in China
- [technical tutorial] national standard protocol platform easygbs cascading supports customized national standard channels
- The latest entry date of SQL Sever test questions
- Can text pictures be converted to word? How to extract text from pictures
- Five methods of JS array summation
- 使用Process Monitor工具监测进程对注册表和文件的操作
- 88. merge ordered arrays
- Process and multithreading
猜你喜欢

Apple's legendary design team disbanded after jobs refused to obey cook

Fais ce que tu veux.

Window function row in SQL Server_ number()rank()dense_ rank()

SQL Server about like operator (including the problem of field data automatically filling in spaces)

Cool interactive animation JS special effects implemented by p5.js

“一次编写,运行各端”,高通重磅发布 AI 软件栈!

Quick completion guide for mechanical arm (I): development overview of mechanical arm
![[data analysis data source] coordinates of provinces, cities and administrative regions across the country (including boundary coordinate points and central coordinate points)](/img/a8/84088b1e61deaf62f22d85a007423b.png)
[data analysis data source] coordinates of provinces, cities and administrative regions across the country (including boundary coordinate points and central coordinate points)

喜歡就去行動

Maui's way of learning -- Opening
随机推荐
The latest entry date of SQL Sever test questions
Besides technology, programmers also need to master a skill - self marketing ability
System design: load balancing
Many of my friends asked me what books and online classes I recommended. This time, I contributed all the materials that I had been hiding for a long time (Part 1)
Stack Title: fractions in parentheses
Attribute observer didset and willset in swift of swiftui swift internal skill
数组怎么转对象,对象怎么转数组
09. Tencent cloud IOT device side learning -- RRPC and behavior
Tencent's open source project "Yinglong" has become a top-level project of Apache: the former long-term service wechat payment can hold a million billion level of data stream processing
Mongodb index operation
Reliable remote code execution (1)
What is wireless WiFi? What are the benefits of wireless WiFi
A method of generating non repeated numbers in nodejs
Does the depth system work?
Simple pricelist style code
2008R2 precautions for configuring L2TP pre shared key VPN
What is recursion?
Plant growth H5 animation JS special effect
Self service troubleshooting guide for redis connection login problems
Tencent wetest platform will bring new benefits in 2021 with 618 special offers!