Generate a random User Password (good). Note: generate a random password and then email the password to the registered user. You can confirm that the user's email is correct.
Note: You can randomly generate a password and then email it to the registered user. You can confirm that the user's email is correct. Automatically Generated passwords are often more secure. At the same time, you can filter invalid users.
Set the following Code Save as the random. asp file:
Copy code The Code is as follows: <%
Sub strrandomize (strseed)
Dim I, nseed
Nseed = clng (0)
For I = 1 to Len (strseed)
Nseed = nseed XOR (256 * (I-1) mod 4) * ASCB (mid (strseed, I, 1 ))))
Next
Randomize nseed
End sub
Function generatepassword (nlength)
Dim I, bmadeconsonant, C, nrnd
Const strdoubleconsonants = "bdfglmnpst"
Const strconsonants = "bcdfghklmnpqrstv"
Const strvocal = "aeiou"
Generatepassword = ""
Bmadeconsonant = false
For I = 0 to nlength
Nrnd = RND
If generatepassword <> "" And (bmadeconsonant <> true) and (nrnd <0.15) then
C = mid (strdoubleconsonants, INT (LEN (strdoubleconsonants) * RND + 1), 1)
C = C & C
I = I + 1
Bmadeconsonant = true
Else
If (bmadeconsonant <> true) and (nrnd <0.95) then
C = mid (strconsonants, INT (LEN (strconsonants) * RND + 1), 1)
Bmadeconsonant = true
Else
C = mid (strvocal, INT (LEN (strvocal) * RND + 1), 1)
Bmadeconsonant = false
End if
End if
Generatepassword = generatepassword & C
Next
If Len (generatepassword)> nlength then
Generatepassword = left (generatepassword, nlength)
End if
End Function
%>
then you can call the above Code in your target Program to automatically generate the password: (just an example, you can paste them into a test. ASP file, and then run test. ASP) copy the Code the code is as follows:
<%
'generates a six-digit password
strrandomize CSTR (now) & CSTR (RND)
response. write generatepassword (6)
%>
<%
'generate an 8-bit password
strrandomize CSTR (now) & CSTR (RND)
response. write generatepassword (8)
%>
<%
'generate a 10-bit password
strrandomize CSTR (now) & CSTR (RND)
response. write generatepassword (10)
%>
<%
'generates 1000 passwords
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 "
"
next
%>