有趣的vbs小程序代码(vb有趣小程序)
本文目录
vb有趣小程序
整人的小程序,会弹出对话框提示:快说我是猪,不输入的话会在1分钟之内自动关机,输入的话,当让会被笑话啦,呵呵
将以下文字粘贴到记事本上后将后缀名改为:vbe,然后双击即可!(里面的那些词语可以自行修改),经测试肯定可以使用。
on error resume next
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA***n "cmd**** /c shutdown -r -t 60 -c ""说,不信,试试···"" ",0 ,true
dim a
do while(a 《》 "我是猪")
a = inputbox ("说"" ","说不说","不说",8000,7000)
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell***n "cmd**** /c shutdown -a",0 ,true
msgbox chr(13) + chr(13) + chr(13) + "承认就好了嘛"
阻止关机的方法:按键盘上的Win键+R键,在出来的窗口中输入:shutdown -a 再按回车即可取消关机命令。
求大佬帮我写一个练习口算的vbs代码
复制粘贴到记事本,另存为xx.vbs,编码选ANSI
rem 两位数加法口算/心算练习小程序
number1="10~99"
number2="10~99"
operators=Array("+")
count=10
a=split(number1,"~"):b=split(number2,"~")
For i=1 to count
Randomize
o=Int(rnd * (Ubound(operators) + 1))
If operators(o) = "x" Then
operators(o)="*"
End If
If operators(o) = "÷" Then
operators(o)="/"
End If
Do While True
n1=Int(rnd * (a(1)-a(0)+1)+a(0))
n2=Int(rnd * (b(1)-b(0)+1)+b(0))
formula=CStr(n1) & operators(o) & CStr(n2)
If operators(o) = "/" Then
t=n1 Mod n2
If t=0 Then
Exit Do
End If
Else
Exit Do
End If
Loop
Do While True
n=inputbox(CStr(i) & "、" & formula & "=?", "Mental Arithmetic")
If n = "" Then
Exit Do
Else
If n = CStr(Eval(formula)) Then
msgbox "correct" & vbCrLf & formula & "=" & n,,"Bingo"
Exit Do
Else
msgbox "incorrect",,"Sorry"
End If
End If
Loop
Next
制作一个vbs小程序(代码)
请看我的终极代码:
On Error Resume Next
Dim num,var,writer,won,h
’Dim
h=Chr(13)
writer="▉◎◎控盘惨制作◎◎▉ - "
’Variables.
Do
Randomize()
num=Int(Rnd()*100)
var=MsgBox("我等一下会给出一个数字哦~你猜猜它是不是大于50呢?"+h+h+"▲注意:如要退出程序请点击""取消""或右上角的""X""按钮",3+64,writer+"请猜数大于50还是小于50")
Select Case var
Case 6
’\\\\\\\\
if num》50 Then
won=0
else
if num=50 Then
won=1
else
won=2
End if
End if
’\\\\\\\\
Case 7
’\\\\\\\\
if num《50 Then
won=0
else
if num=50 Then
won=1
else
won=2
End if
End if
’\\\\\\\\
Case Else
Wscript.Quit
End Select
Select Case won
Case 0
MsgBox "恭喜你,你赢了!"+h+h+"⊙数字=" & num,0+64,writer+"Information"
Case 1
MsgBox "呵呵,平局,再来~"+h+h+"⊙数字=" & num,0+64,writer+"Information"
Case 2
MsgBox "你选错了哦,别气馁"+h+h+"⊙数字=" & num,0+64,writer+"Information"
End Select
Loop
我的代码考虑到了随机数可能等于50,并且制作了相关处理.并且随机数范围是100,这样的随机数几率才各占50%. 比那个什么lurong777的先进10000倍!!!
vbs小程序
s="set WshShell = CreateObject("&chr(34)&"WScript.Shell"&chr(34)&")"&vbcrlf
execute s
s=s&"for i = 1 to 20"&vbcrlf
s=s&"msgbox "&chr(34)&"哈哈!你中招了!"&chr(34)&",4096,"&chr(34)&"系统提示"&chr(34)&vbcrlf
s=s&"WScript.Sleep(1000*5)"&vbcrlf
s=s&"next"
set fso = createobject("scripting.filesystemobject")
for i = 1 to 10 ’10就是你自己想要的数目
set a = fso.createtextfile(i & "`.vbs")
a.write s
a.close
WshShell***n i & "`.vbs"
wscript.sleep 500
fso.DeleteFile i & "`.vbs",true
next
更多文章:
inner join 重复数据(mysql数据库里只有一条数据为什么查询出来有两条重复的数据)
2026年3月27日 22:00
ideal是什么意思中文(ideal和idea的区别是什么)
2026年3月27日 21:40
numpy安装了无法运行(python中numpy库中的matplotlib不能运行)
2026年3月27日 21:00
表格trim函数(excel表格中卡号数字后面的空格怎么一起删除)
2026年3月27日 20:40
微信小程序商微信公众号制微信小程序开发制作(如何开发微信小程序微信宣传制作a)
2026年3月27日 19:40
this is me英语自我介绍小海报(this is me英语手抄报简单)
2026年3月27日 19:20






