帮助继续VBS字符串?

时间:2011-05-13 23:06:24

标签: 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,任何帮助都会受到高度赞赏。!!

1 个答案:

答案 0 :(得分:0)

我很难理解你的问题 无论如何,如果你需要在密码错误时退出,你可以试试这个:

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:")

<强>更新
请查看从here获取的代码:

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