ASP generates a random string of 13 BITs (loop output for 500 times without error)

Source: Internet
Author: User
<% @ Language = VBScript %>


<%
The 'digits parameter indicates the number of digits of a random number.
Function getkey (digits)

Dim char_array (36)
Dim output, num
Char_array (0) = "0"
Char_array (1) = "1"
Char_array (2) = "2"
Char_array (3) = "3"
Char_array (4) = "4"
Char_array (5) = "5"
Char_array (6) = "6"
Char_array (7) = "7"
Char_array (8) = "8"
Char_array (9) = "9"
Char_array (10) = ""
Char_array (11) = "S"
Char_array (12) = "D"
Char_array (13) = "F"
Char_array (14) = "e"
Char_array (15) = "F"
Char_array (16) = "G"
Char_array (17) = "H"
Char_array (18) = "I"
Char_array (19) = "J"
Char_array (20) = "K"
Char_array (21) = "L"
Char_array (22) = "M"
Char_array (23) = "N"
Char_array (24) = "O"
Char_array (25) = "P"
Char_array (26) = "Q"
Char_array (27) = "R"
Char_array (28) = "S"
Char_array (29) = "T"
Char_array (30) = "U"
Char_array (31) = "V"
Char_array (32) = "W"
Char_array (33) = "X"
Char_array (34) = "Y"
Char_array (35) = "Z"

Randomize

Do While Len (output) <digits
Num = char_array (INT (35) * RND + 0 ))
Output = output + num
Loop

Getkey = Output
End Function

'Return the result to the browser
Response. write "the 13-digit random string generated by this instance is :"
Response. Write "<center>"
For J = 0-500
Response. Write getkey (13)
Response. Write "<br>"
Next

Response. Write "</center>"
%>

 

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.