Asp中随机产生用户密码的代码(2)
GeneratePassword = Left(GeneratePassword, nLength)
End If
End Function
%>
复制代码 代码如下:
<!--include file="random.asp" -->
<%
'产生一个六位的密码
StrRandomize CStr(Now) & CStr(Rnd)
response.write GeneratePassword(6)
%>
<br><br>
<%
'产生一个8位的密码
StrRandomize CStr(Now) & CStr(Rnd)
response.write GeneratePassword(8)
%>
<br><br>
<%
'产生一个10位的密码
StrRandomize CStr(Now) & CStr(Rnd)
response.write GeneratePassword(10)
%>
<br><br>
<%
'产生1000个密码
dim t, t2
for t = 1 to 500
For t2 = 1 to 661
StrRandomize CStr(Now) & CStr(Rnd)
next
StrRandomize CStr(Now) & CStr(Rnd)
response.write GeneratePassword(6)
response.write "<br>"
next
%>