newasp中main类(57)
Public Function GetRandomCode()
Dim Ran, i, LengthNum
LengthNum = 16
GetRandomCode = ""
For i = 1 To LengthNum
Randomize
Ran = CInt(Rnd * 2)
Randomize
If Ran = 0 Then
Ran = CInt(Rnd * 25) + 97
GetRandomCode = GetRandomCode & UCase(Chr(Ran))
ElseIf Ran = 1 Then
Ran = CInt(Rnd * 9)
GetRandomCode = GetRandomCode & Ran
ElseIf Ran = 2 Then
Ran = CInt(Rnd * 25) + 97
GetRandomCode = GetRandomCode & Chr(Ran)
End If
Next
End Function
'================================================
' 函数名:CodeIsTrue
' 作 用:检查验证码是否正确
'================================================
Public Function CodeIsTrue()
Dim CodeStr
CodeStr = Trim(Request("CodeStr"))
On Error Resume Next
If CStr(Session("GetCode")) = CStr(CodeStr) And CodeStr <> "" Then
CodeIsTrue = True
Session("GetCode") = Empty
内容版权声明:除非注明,否则皆为本站原创文章。