一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

一个获得随机字符串的asp函数

时间:2008-01-18 编辑:简简单单 来源:一聚教程网

response.write getCode(10) '得到一个长度为10 的随机字符串
Function getCode(iCount)
Dim arrChar
Dim j,k,strCode
arrChar = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
k=Len(arrChar)
Randomize
For i=1 to iCount
j=Int(k * Rnd )+1
strCode = strCode & Mid(arrChar,j,1)
Next
getCode = strCode
End Function

热门栏目