系统分配随机密码
程序员文章站
2023-08-24 12:14:32
复制代码 代码如下:<% '系统分配随机密码 function createpass() &nb...
复制代码 代码如下:
<%
'系统分配随机密码
function createpass()
dim ran, i, lengthnum
lengthnum = 6
createpass = ""
for i = 1 to lengthnum
randomize
ran = cint(rnd * 2)
randomize
if ran = 0 then
ran = cint(rnd * 25) + 97
createpass = createpass & ucase(chr(ran))
elseif ran = 1 then
ran = cint(rnd * 9)
createpass = createpass & ran
elseif ran = 2 then
ran = cint(rnd * 25) + 97
createpass = createpass & chr(ran)
end if
next
end function
response.write createpass()
%>