<%
'*********************************
'Function: MakePassword(byvalmaxlen)
'Parameter: maxlen, the length of the password digits to be generated
'Author: Alixi
'Date: 2007/7/12
'Description: Generate random passwords of any number of digits
'Example: <%=MakePassword(8)%>
'*********************************
functionMakePassword(byvalmaxlen)
dimstrnewpass
dimwhatsnext, upper, lower, intcounter
randomize
forintcounter=1tomaxlen
whatsnext=int((1-0+1)*rnd+0)
ifwhatsnext=0then
'character
upper=90
lower=65
else
upper=57
lower=48
endif
strnewpass=strnewpass&chr(int((upper-lower+1)*rnd+lower))
next
makepassword=strnewpass
endfunction
%>