CopyCodeThe Code is as follows: <%
Randomize
Do While Len (PASS) <12' random password digits
Num1 = CSTR (CHR (57-48) * RND + 48) '0 ~ 9
Num2 = CSTR (CHR (90-65) * RND + 65) 'A ~ Z
Num3 = CSTR (CHR (122-97) * RND + 97) 'A ~ Z
Pass = pass & num1 & num2 & num3
Loop
%>
<% = Pass %>
1. The role of Xiaoyu is actually the role of Xiaoyu.
2. In the book, the formula for generating a random number within a certain range is
(<Upper limit>-<lower limit> + 1) * RND + <lower limit>
But the actual running result is: lower limit -- upper limit + 1
(<Upper limit>-<lower limit>) * RND + <lower limit> is correct.
3. Generate a random password. Each of the three digits is a group. The first digit is a number, the second digit is a capital letter, and the third digit is a lowercase letter, which of the following experts can tell me how to make random numbers randomly?Copy codeThe Code is as follows: <%
Sub SJS (N)
Randomize
Response. Write int (RND * n)
End sub
'N' is the maximum random number.
%>