站长资源网络编程

asp 随机字符串函数

整理:jimmy2024/10/28浏览2
简介'************************************* 'asp计算随机数 '************************************* Function randomStr(intLength) Dim strSeed, seedLength, pos, St
'*************************************
'asp计算随机数
'*************************************

Function randomStr(intLength)
Dim strSeed, seedLength, pos, Str, i
strSeed = "abcdefghijklmnopqrstuvwxyz1234567890"
seedLength = Len(strSeed)
Str = ""
Randomize
For i = 1 To intLength
Str = Str + Mid(strSeed, Int(seedLength * Rnd) + 1, 1)
Next
randomStr = Str
End Function