验证码问题帮助! [英] CAPTCHA Problem help!

查看:120
本文介绍了验证码问题帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能使验证码自动刷新?请帮助

这是
<%@    页面   语言  ="  %> 
<%@    导入   命名空间  ="  <%@    导入   命名空间  ="  <  脚本    ="  服务器" 受保护的 无效 Page_Load(对象发​​件人,EventArgs e)
    {
        随机兰德=  Random();
         int  intNum = Rand.Next( 100000  999999 );

        位图Bmp = 位图( 90  50 );

        图形Gfx = Graphics.FromImage(Bmp);
        Gfx.Clear(Color.White);

        字体Fnt = 字体("  13 ,FontStyle.Bold);

        Gfx.DrawString(intNum.ToString(),Fnt,Brushes.Red, 15  15 ));

         int  RandY1 = Rand.Next( 0  50 );
         int  RandY2 = Rand.Next( 0  50 );
        Gfx.DrawLine(Pens.Black, 0 ,RandY1, 90 ,RandY2);

        RandY1 = Rand.Next( 0  50 );
        RandY2 = Rand.Next( 0  50 );
        Gfx.DrawLine(Pens.Black, 90 ,RandY1, 0 ,RandY2);

        RandY1 = Rand.Next( 0  50 );
        RandY2 = Rand.Next( 0  50 );
        Gfx.DrawLine(Pens.Black, 0 ,RandY1, 90 ,RandY2);

        Bmp.Save(Response.OutputStream,ImageFormat.Gif);
        会话[" ] = intNum;
    }
</ 脚本 > 
<  !DOCTYPE     html     PUBLIC    -//W3C//DTD   XHTML     1.0    过渡//EN" " http://www.w3. org/TR/xhtml1/DTD/xhtml1-transitional.dtd" <   html     ="   http://www.w3.org/1999/xhtml" > 
<      ="  服务器" <  标题 >  CaptchaImage <  /title  > 
<  /head  > 
<  正文 > 
<  /body  > 
<  /html  >  

解决方案

为什么要创建自己的机器(很可能是机器可读的)?为什么要重新发明轮子?
相反,为什么不使用验证码 [ ^ ]代替?它是免费的,安全的,并且有助于将图书转换为电子格式,因此它向您显示了对用户的关心(无论如何,这些用户都知道这些事情)


how can i make the captcha refresh autometically ???? please help

this is
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing"%>
<%@ Import Namespace="System.Drawing.Imaging"%>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Random Rand = new Random();
        int intNum = Rand.Next(100000, 999999);

        Bitmap Bmp = new Bitmap(90, 50);

        Graphics Gfx = Graphics.FromImage(Bmp);
        Gfx.Clear(Color.White);

        Font Fnt = new Font("Fandango", 13, FontStyle.Bold);

        Gfx.DrawString(intNum.ToString(), Fnt, Brushes.Red, 15, 15);

        int RandY1 = Rand.Next(0, 50);
        int RandY2 = Rand.Next(0, 50);
        Gfx.DrawLine(Pens.Black, 0, RandY1, 90, RandY2);

        RandY1 = Rand.Next(0, 50);
        RandY2 = Rand.Next(0, 50);
        Gfx.DrawLine(Pens.Black, 90, RandY1, 0, RandY2);

        RandY1 = Rand.Next(0, 50);
        RandY2 = Rand.Next(0, 50);
        Gfx.DrawLine(Pens.Black, 0, RandY1, 90, RandY2);

        Bmp.Save(Response.OutputStream, ImageFormat.Gif);
        Session["VerfiNum"] = intNum;
    }
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

<title>CaptchaImage</title>
</head>
<body>
</body>
</html>

解决方案

Why create your own, which is quite likely to be machine readable? Why re-invent the wheel?
Instead, why not use Recaptcha[^] instead? It''s free, it''s secure, and it helps to get books into electronic format, so it shows you care to your users (those that know about these things, anyway)


这篇关于验证码问题帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆