Vbscript 简单密码登录次数尝试 fso=InputBox(“要验证您是这台计算机的系统管理员,请输入您的登录密码。”) 迪姆·奥谢尔 设置oShell=CreateObject(“WSCript.shell”) 尝试次数=0 如果是fso“密码”,则 cnt=+1 如果结束 如果cnt=3,则 oShell.run(“notepad.exe”) wscript.Quit 如果结束 如果fso=“PASSWORD”,则 oShell.run(“calc.exe”) 如果结束

Vbscript 简单密码登录次数尝试 fso=InputBox(“要验证您是这台计算机的系统管理员,请输入您的登录密码。”) 迪姆·奥谢尔 设置oShell=CreateObject(“WSCript.shell”) 尝试次数=0 如果是fso“密码”,则 cnt=+1 如果结束 如果cnt=3,则 oShell.run(“notepad.exe”) wscript.Quit 如果结束 如果fso=“PASSWORD”,则 oShell.run(“calc.exe”) 如果结束,vbscript,passwords,Vbscript,Passwords,各位好,, 我已经尝试过上面的简单代码,它要求输入简单的密码。我无法让计数尝试正常工作,我需要它在执行错误密码脚本之前至少3次请求正确的密码。请帮忙!提前感谢:)如果你需要重复一个动作不止一次,你需要使用循环,比如Do或For循环。感谢Lankymart,这让我走上了正确的方向。 fso = InputBox("To verify that you're the system administrator of this computer, please enter your login pass

各位好,,
我已经尝试过上面的简单代码,它要求输入简单的密码。我无法让计数尝试正常工作,我需要它在执行错误密码脚本之前至少3次请求正确的密码。请帮忙!提前感谢:)

如果你需要重复一个动作不止一次,你需要使用循环,比如
Do
For
循环。感谢Lankymart,这让我走上了正确的方向。
fso = InputBox("To verify that you're the system administrator of this computer, please enter your login password.")

Dim oShell, cntAttempts
Set oShell = CreateObject ("WSCript.shell")
cntAttempts = 0

if fso <> "PASSWORD" then 
cntAttempts = +1
end if
if cntAttempts = 3 Then
oShell.run ("notepad.exe")
wscript.Quit 
end if 


if fso = "PASSWORD" then
oShell.run ("calc.exe")

end if