<%
'ASP Generates Random Strings (Number + Lower and Lower Case Letters) Exercise
'A Huinan practices for me, not what I want
FunctionrandKey(obj)
Dimchar_array(80)
Dimtemp
Fori=0To9
char_array(i)=Cstr(i)
Next
Fori=10To35
char_array(i)=Chr(i+55)
Next
Fori=36To61
char_array(i)=Chr(i+61)
Next
Randomize
Fori=1Toobj
The random number returned by the 'rnd function is between 0 and 1, which can be equal to 0, but not 1
'Formula: int((upper limit-lower limit+1)*Rnd+lower limit) can obtain the number from the lower limit to the upper limit, which can be equal to the lower limit but cannot be equal to the upper limit
temp=temp&char_array(int(62-0+1)*Rnd+0)
Next
randKey=temp
EndFunction
Response.Write(randKey(6))
%>