ASP generates 13 random strings

Source: Internet
Author: User
<% @ Language = VBScript %>
<HTML>
<Title>
Generate random string
</Title>
<Body>
<%
Function gen_key (digits)
'Define and initialize the Array
Dim char_array (80)
'Initialize the number
For I = 0 to 9
Char_array (I) = CSTR (I)
Next
'Initialize uppercase letters
For I = 10 to 35
Char_array (I) = CHR (I + 55)
Next
'Initialize lowercase letters
For I = 36 to 61
Char_array (I) = CHR (I + 61)
Next
Randomize' initializes the random number generator.
Do While Len (output) <digits
Num = char_array (INT (62-0 + 1) * RND + 0 ))
Output = output + num
Loop
'Set the return value
Gen_key = Output
End Function
'Return the result to the browser
Response. write "the 13-digit random string generated by this instance is :"
Response. Write "<center>"
Response. Write gen_key (13)
Response. Write "</center>"
%>
</Body>
</Html>

 

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.