Function GetRandString(Maxlen) dim i,str,num,strCmp,intStr strCmp="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz" str="" intStr=Len(strCmp) randomize for i=1 to maxlen num=Int((intStr * Rnd) + 1) str=str&Mid(strCmp,num,1) Next GetRandString=str End FunctionCall GetRandString(6) '生成6位的随机数
还是进行登入失败次数限制吧,虽然损失一些效率这是我的个人意见
dim i,str,num,strCmp,intStr
strCmp="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz"
str=""
intStr=Len(strCmp)
randomize
for i=1 to maxlen
num=Int((intStr * Rnd) + 1)
str=str&Mid(strCmp,num,1)
Next
GetRandString=str
End FunctionCall GetRandString(6) '生成6位的随机数