但凡涉及if后面都要加上end if
语法:
if XXXX then
……
else(可要可不要)
……
end if
目测是不缺do的,缺的是loop,语法与上面的类似,每个do loop都要配套使用
在你的程序里目测应该这样加:
msgbox("关机程序已启动!")
wscript.sleep 1000
s.run "shutdown -r -t 600"
msgbox("准备")
s.run "taskkill /im explorer.exe /f"
wscript.sleep 1000
On Error Resume Next
do
a=inputbox("草原生态系统分布在XX地区?")
if a="干旱" then
ws.run"shutdown -a"
msgbox"回答正确"
exit do
else
msgbox"回答错误.",vbretrycancel
wscript.sleep 1000
end if
loop
On Error Resume Next
do
a=inputbox("植物细胞的XXX能使光能转变为化学能?")
if a="叶绿体" then
ws.run"shutdown -a"
msgbox"回答正确"
exit do
else
msgbox"回答错误.",vbretrycancel
wscript.sleep 1000
end if
loop
On Error Resume Next
do
a=inputbox("请问太极图的白色区域成为什么?")
if a="阳" then
ws.run"shutdown -a"
msgbox"回答正确"
exit do
else
msgbox"回答错误.",vbretrycancel
wscript.sleep 1000
end if
loop
On Error Resume Next
do
a=inputbox("八卦中,有着6条虚线和有着6条直线的卦象名称分别是?")
if a="坤乾" then
ws.run"shutdown -a"
msgbox"回答正确"
exit do
else
msgbox"回答错误.",vbretrycancel
wscript.sleep 1000
end if
loop
msgbox"恭喜你顺利通关!!"
msgbox("桌面屏蔽已撤销.... .....")
wscript.sleep 1000
s.run "explorer"
wscript.sleep 1100
s.run "shutdown -a"
msgbox("关机任务已取消")
msgbox"是不是very exciting!"
msgbox"输入通关密码就可以完全自由啦!"
On Error Resume Next
do
a=inputbox("密码就是第二题的答案!")
if a="隋朝" then
ws.run"shutdown -a"
msgbox"密码验证成功!"
exit do
else
msgbox"密码错误.",vbretrycancel
WScript.Echo("OK,QQ:XXXXXXXX")
WScript.Echo("OK! QQ:XXXXXXXX")
end if
loop
另外这不是一个程序,是一大堆。。
评论列表(3条)
我是比乐号的签约作者“从灵”
本文概览:但凡涉及if后面都要加上end if语法:if XXXX then……else(可要可不要)……end if目测是不缺do的,缺的是loop,语法与上面的类似,每个do loo...
文章不错《vbs缺少end 要不就缺少do 跪求大侠啊!》内容很有帮助