Randomly generates n digits and letters of a password

Source: Internet
Author: User
Random <%
Randomize
Do While Len (pass) <12 ' random number of 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 less than the number is actually small equal to the role
2, the book said that the formation of a range of random number formula is
(< upper >-< lower >+1) *rnd+< lower limit >
But the actual operation result is: lower limit--upper limit +1
(< upper >-< lower limit >) *rnd+< the lower bound > is the correct
3, the generation of random password for each 3-digit group, the first digit, the second is a capital letter, the third is a lowercase letter, which master can tell me how to let random number of positions is also random?



Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.