关于VBS变量的一个问题,变量在必要时应该用什么符号括起来

来源:百度知道 编辑:UC知道 时间:2024/06/17 21:46:10
我做了一个密码窗口,代码如下:
dim a,wshshell,ctr
const pass="nb520"
ctr=3
do
if ctr=0 then
msgbox("您已经失去了最后一次机会,byebye...")
exit do
else
end if
a=inputbox("请输入密码:","提示!")
if a=pass then
msgbox "恭喜您!密码输入正确!",,"校验成功!"
set wshshell = wscript.createobject("wscript.shell")
WshShell.Run "D:\Progra~1\Tencent\QQPlayer\QQPlayer.exe"
exit do
else
ctr=ctr-1
msgbox("再给你%ctr%次机会吧!") //--问题在这里,怎么让他显示次数ctr
end if
loop

dim a,wshshell,ctr
const pass="nb520"
ctr=3
do
if ctr=0 then
msgbox("您已经失去了最后一次机会,byebye...")
exit do
else
end if
a=inputbox("请输入密码:","提示!")
if a=pass then
msgbox "恭喜您!密码输入正确!",,"校验成功!"
set wshshell = wscript.createobject("wscript.shell")
WshShell.Run "D:\Progra~1\Tencent\QQPlayer\QQPlayer.exe"
exit do
else
ctr=ctr-1
msgbox("再给你"&ctr&"次机会吧!")
end if
loop