28,409
社区成员




<%
dim rndnum,verifycode
Randomize
Do While Len(rndnum)<4
num1=CStr(Chr((57-48)*rnd+48))
rndnum=rndnum&num1
loop
session("verifycode")=rndnum
%>
<%
Response.Write ValGetNumber(4)
Function ValGetNumber(n)
Dim s
Dim i, iRandom, iUpper, iLower
s = ""
iUpper = 10 ^ n -1
iLower = 10 ^ (n-2)
Randomize
iRandom = CInt((iUpper - iLower) * Rnd + iLower)
s = CStr(iRandom)
If Len(s) = 3 Then
Randomize
s = s & CStr(CInt(Rnd() * 9))
End If
ValGetNumber = s
End Function
%>