VBS中遇到两个if··then··else··end if怎么办?

2025-04-04 11:48:47
推荐回答(2个)
回答1:

const pass="abc"
a=inputbox("我有东西给你看,想看吗?那就先请输入密码:","登录")

if a=pass then

b=inputbox("想看?Y or N")
if Lcase(b) = "y" then
c=inputbox("真的想看?Y or N")
if Lcase(c) = "y" then
msgbox("我想说的话")
else
msgbox("不想看就算了")
end if
else
msgbox("不想看就算了")
wscript.quit
end if

end if

试试吧。

这样差不多了。。

回答2:

dim a,b,c
a=inputbox("我有东西给你看,想看吗?那就先请输入密码:","登录")
if a="abc" then
b=inputbox("想看?Y or N")
if b="y" then
c=inputbox("真的想看?Y or N")
if c="y" then
msgbox"我想说的话"
else
msgbox"不想看就算了"
end if
else
msgbox"不想看就算了"
end if
else
msgbox"密码错误!"
end if