简单修改将验证码改为加减法计算

打开common\function.asp,找到
Function getcode()
    getcode = "<img id=""vcodeImg"" src=""about:blank"" onerror=""this.onerror=null;this.src='common/getcode.asp?s='+Math.random();"" alt=""验证码"" title=""看不清楚?换一张"" style=""margin-right:40px;cursor:pointer;width:40px;height:18px;margin-bottom:-4px;margin-top:3px;"" onclick=""src='common/getcode.asp?s='+Math.random()""/>"
End Function

直接替换为:
Function getcode()
    Dim code, code1, codet
    Randomize
    If Int(Rnd * 2 + 1) = 1 Then
        codet = "+"
    Else
        codet = "-"
    End If
    Randomize
    code = Int(Rnd * 100 + 1)
    Randomize
    code1 = Int(Rnd * 100 + 1)
    If codet = "+" Then
        Session("GetCode") = code + code1
        getcode =  code & "+" & code1 & "=?"  
    ElseIf code > code1 Then
        Session("GetCode") = code - code1
        getcode =  code & "-" & code1 & "=?"  
    Else
        Session("GetCode") = code1 - code
        getcode =  code1 & "-" & code & "=?"  
    End if
'    getcode = "<img id=""vcodeImg"" src=""about:blank"" onerror=""this.onerror=null;this.src='common/getcode.asp?s='+Math.random();"" alt=""验证码"" title=""看不清楚?换一张"" style=""margin-right:40px;cursor:pointer;width:40px;height:18px;margin-bottom:-4px;margin-top:3px;"" onclick=""src='common/getcode.asp?s='+Math.random()""/>"
End Function


评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 支持Gravatar头像.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.