ASP instance tutorial This article introduces you how to generate random string, and this example introduces how to generate 13 random string.
<html>
<Title>
Student starting string www.vevb.com </Title>
<body>
<%
Function Gen_key (Digits)
'Definition and initialize the array
dim char_array (80)
'Initialization number
For i = 0 to 9
char_array (i) = cstr (i)
Next
'Initialization of uppercase letters
For i = 10 to 35
char_array (i) = chr (i + 55)
Next
'Initialize a lowercase letter
For i = 36 to 61
char_array (i) = chr (i + 61)
Next
Randomize Timer 'initialize random number generator.
Do while len (output) <Digits
NUM = CHAR_ARAY (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 thirteen random string generated by this instance is:
response.write <Center>
response.write geen_key (13)
response.write </center>
%>
</body>
</html>