回 帖 发 新 帖 刷新版面

主题:那位有这个验证吗的,代码啊?

那位有这个验证吗的,源代码啊?
[img]http://www1.freep.cn/Photo.php?url=photo5/0704021236597674.bmp[/img]

回复列表 (共5个回复)

沙发

怎么没有人有吗?

板凳

跟你要求一样的没有,不一样的网上到处都是,找找就ok

3 楼

也许您可以参昭下面的代码:
  编写随机产生位数的验证码的函数randStr(),该函数只有一个参数Vidigit,用于指定生成的字符串的位数,返回值为指定位数的随机字符串。将其保存为function.asp文件中。
<%
  function randstr(Vdigit)
   {
      numn="0,1,2,3,o,p"  '这里是可以继续添加别的字符
      numns=split(numn,",")
      for i=1 to Vdigit
       Randomize
        unm1=numns(int(Ubound(numns))*rnd)
        num=num&num1
      next
      randStr=num
   end function
%>
   在需要随机产生指定位数的验证码的页面中首先包含function.asp文件,然后再调用randStr()函数获取指定位数的字符串,并显示
  <!-- #include file="function.asp">
   <%
      digit=request.form("digit")
         if digit="" then
            digit=4 
         end if
   %>
   产生的随机数字符:<% =random(digit) %>[em15][em15]

4 楼

<%
Function gen_key(digits)
'定义并初始化数组
    dim char_array(80)
    '初始化数字
    For i = 0 To 9
        char_array(i) = CStr(i)
    Next
    '初始化大写字母
    For i = 10 To 35
        char_array(i) = Chr(i + 55)
    Next
    '初始化小写字母
    For i = 36 To 61
        char_array(i) = Chr(i + 61)
    Next
    Randomize   '初始化随机数生成器。
    do while len(output) < digits
        num = char_array(Int((62 - 0 + 1) * Rnd + 0))
        output = output + num
    loop
'设置返回值
    gen_key    =    output
End Function
'把结果返回给浏览器
response.write "<center>"
response.write gen_key(6)
response.write "</center>"
%>

我这个代码是随机产生6位数,对你应该有点帮助.

5 楼

动易的验证码就是这样的,把他的拷过来就可以了

我来回复

您尚未登录,请登录后再回复。点此登录或注册