asp随机生成

来源:百度知道 编辑:UC知道 时间:2024/09/12 22:11:54
用户名 8-12位,数字和字母
密码 6-8位,数字和字母
地区 北京,上海,天津,河南,河北,山东等,33个就够
邮编 其实也不是邮编 就是6位数字

以上这些随机生成。越详细越好。最好是让我把代码复制到文本文件里改成.asp就能用。(为什么我不能悬赏200?那我追加)
asp.net也行 只要能让我生成这些东西就ok

Function Generator(Length)
Dim i, tempS
tempS = "1234567890abcdefghijklmnopqrstuvwxyz"
Generator = ""
If isNumeric(Length) = False Then
Exit Function
End If
For i = 1 to Length
Randomize
Generator = Generator & Mid(tempS,Int((Len(tempS) * Rnd) + 1),1)
Next
End Function

引用的时候用Generator(Length) ,length换成数字,即为你想要的位数

Function Generator(Length)
Dim i, tempS
tempS = "1234567890abcdefghijklmnopqrstuvwxyz"
Generator = ""
If isNumeric(Length) = False Then
Exit Function
End If
For i = 1 to Length
Randomize
Generator = Generator & Mid(tempS,Int((Len(tempS) * Rnd) + 1),1)
Next
End Function

Function Generator(Length)
Dim i, tempS
tempS = "1234567890abcdefghijklmnopqrstuvwxyz"
Generator = ""
If isNumeric(Length) = False Then
Exit Function
End