关键词:asp产生随机数,asp产生随机数和字母 asp产生随机字母,asp产生随机数数字,asp产生随机数

<%

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

response.write getCode(10) '得到一个长度为10 的随机字符串

%>