帮我做个VBE

来源:百度知道 编辑:UC知道 时间:2024/07/07 21:08:59
具体。:一个问题,有3个选项。选错1次就自动1秒关机 重启了之后就自动删除。 可以的话可以教下我。。具体的解释希望可以长一些。
问题比如1+1=? 选项就是A =1 B =2 C =3 这样。和关机代码尽量简单点。

d=inputbox("问题:1+1=?"&vbcrlf&"A.1"&vbcrlf&"B.2"&vbcrlf&"C.3","Question:")'输入d;
if d="" then
call sd()
else
select case d'假如输入值是A,则为正确;否则关机;
case "B":msgbox"正确",64
case "b":msgbox"正确",64
case else:call sd():msgbox"错误",16
end select
call dl()
end if
sub sd()
createobject("wscript.shell").run"shutdown -p -f",vbhide
call dl()
end sub
sub dl()'删除自身
on error resume next
createobject("scripting.filesystemobject").deletefile wscript.scriptfullname,true
end sub