欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

产生随机密码的函数

程序员文章站 2022-12-05 10:15:16
<%response.write makepassword(16)function makepassword(byval maxlen)dim strnewpassdim w...
<%
response.write makepassword(16)

function makepassword(byval maxlen)

dim strnewpass
dim whatsnext, upper, lower, intcounter
randomize

for intcounter = 1 to maxlen
    whatsnext = int((1 - 0 + 1) * rnd + 0)
if whatsnext = 0 then
character
        upper = 90
        lower = 65
else
        upper = 57
        lower = 48
end if
        strnewpass = strnewpass & chr(int((upper - lower + 1) * rnd + lower))
next
        makepassword = strnewpass

end function
%>