Vbscript 帮助继续VBS字符串?

Vbscript 帮助继续VBS字符串?,vbscript,Vbscript,我对VBScript和一般的计算机编程非常陌生。 如果我这样做: a=inputbox("Password:") if a="Drop Zero" then msgbox"Loging On" else msgbox"Invalid" end if a=inputbox("Hello, what would you like to know:") 在第二个输入框之后,我无法继续使用if和else。对于像我这样的nOOb,任何帮助都将不胜感激 我很难理解你的问题。 无论

我对VBScript和一般的计算机编程非常陌生。 如果我这样做:

a=inputbox("Password:") 
if a="Drop Zero" then 
    msgbox"Loging On" 
else
    msgbox"Invalid"
end if 

a=inputbox("Hello, what would you like to know:")

在第二个输入框之后,我无法继续使用if和else。对于像我这样的nOOb,任何帮助都将不胜感激

我很难理解你的问题。 无论如何,如果您需要在密码错误时退出,您可以尝试以下操作:

a=inputbox("Password:") 
if a="Drop Zero" then 
    msgbox"Logging On" 
else
    msgbox"Invalid"
    WScript.Quit
end if 

a=inputbox("Hello, what would you like to know:")
更新: 请看以下代码:


是否可以有多个if,else,end-if语句?@user753143:我编辑了我的文章,举了一个例子。答案是肯定的,你需要多少就有多少
Function ValidInteger(sNumber,iMin,iMax)

    If IsNumeric(sNumber) = 0 Then
        If InStr(sNumber,".") Then
            If CLng(sNumber)>= iMin And CLng(sNumber)<= iMax Then 
                ValidInteger=""
            Else
                ValidInteger = "You must enter a number between " & iMin & " and " & iMax
            End If
        Else
            ValidInteger = "You must enter a whole number"
        End If
    Else
        ValidInteger = "You must enter a number value"
    End If
End Function