Random generation of n-bit password ASP random number consisting of digits and letters
Source: Internet
Author: User
Random generation of n-bit password ASP random number consisting of digits and letters <%
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?
<%
Sub SJS (N)
Randomize
Response. Write int (RND * n)
End sub
'N' is the maximum random number.
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service