验证码接收

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CZBK.ItcastProject.Common; namespace CZBK.ItcastProject.WebApp._2015_5_29
{
/// <summary>
/// ValidateImageCode 的摘要说明
/// </summary>
public class ValidateImageCode : IHttpHandler
{ public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
ValidateCode validatecode = new ValidateCode();
string code= validatecode.CreateValidateCode();
validatecode.CreateValidateGraphic(code, context);
} public bool IsReusable
{
get
{
return false;
}
}
}
}

登录页面(实现验证码点击替换)

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
window.onload = function () {
var validateCode = document.getElementById("validateCode");
validateCode.onclick = function () {
document.getElementById("imgCode").src = "ValidateImageCode.ashx?d=" + new Date().getMilliseconds();
}
}
</script>
</head>
<body>
<form method="post" action="UserLogin.ashx">
用户名:<input type="text" name="txtName" /><br />
密码:<input type="password" name="txtPwd" /><br />
验证码:<input type="text" name="txtCode" /><img src="ValidateImageCode.ashx" id="imgCode" />
<a href="javascript:void(0)" id="validateCode">看不清</a><br />
<input type="submit" value="登录" />
</form>
</body>
</html>

Common工具类的验证码类的使用(未实现验证)的更多相关文章

  1. pdo文字水印类,验证码类,缩略图类,logo类

    文字水印类 image.class.php <?php /** * webrx.cn qq:7031633 * @author webrx * @copyright copyright (c) ...

  2. PHP常用类------生成验证码类Code

    直接附上代码吧!很简单的代码,写一遍基本就会了,主要明白用GD库画图的几个步骤: 1.先创建画布,不然画在哪儿?(imagecreatetruecolor)2.根据要画的数据,选定颜色 (imagec ...

  3. ThinkPHP 3.2.3 加减乘法验证码类

    ThinkPHP 3.2.3 自带的验证码类位于 /ThinkPHP/Library/Think/Verify.class.php,字体文件位于 /ThinkPHP/Library/Think/Ver ...

  4. C#工具:加密解密帮助类

    using System; using System.IO; using System.Security.Cryptography; using System.Text; //加密字符串,注意strE ...

  5. mongoDB工具类以及测试类【java】

    java操作mongo工具类 package Utils; import com.mongodb.MongoClient; import com.mongodb.MongoCredential; im ...

  6. 完整验证码类(validityHelper)(代码+使用)

    using System; using System.Web; using System.Drawing; using System.Security.Cryptography; namespace ...

  7. Gif验证码类

    package com.paic.bics.common.utils.vcode; import java.awt.AlphaComposite; import java.awt.Color; imp ...

  8. PHP-解析验证码类--学习笔记

    1.开始 在 网上看到使用PHP写的ValidateCode生成验证码码类,感觉不错,特拿来分析学习一下. 2.类图 3.验证码类部分代码 3.1  定义变量 //随机因子 private $char ...

  9. THINKPHP源码学习--------验证码类

    TP3.2验证码类的理解 今天在学习中用到了THINKPHP验证码,为了了解究竟,就开始阅读TP验证码的源码. 源码位置:./ThinkPHP/Library/Think/Verify.class.p ...

随机推荐

  1. (剑指Offer)面试题25:二叉树中和为某一值的路径

    题目: 输入一颗二叉树和一个整数,打印出二叉树中结点值的和为输入整数的所有路径.路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径. 二叉树结点的定义: struct TreeNode ...

  2. ubuntu: qemu+gdb 调试linux kernel 学习笔记

    声明: 本笔记内容并非本人原创,90%来自网络资料的整合.同时,由于自己是刚刚接触qemu & gdbserver remote debug,本文也就算不得教程,仅供有缘人参考而已. ---- ...

  3. jQuery生成全页面的悬浮覆盖层效果(overlay)

    可能在大家开发的过程中,往往需要自己生成一个全页面的覆盖层,以便让用户能够把注意力专注于开发者指定的某一个区域,在这里开发小技巧里,我们使用非常简单的代码生成类似的效果,如下: $("#ov ...

  4. ITEXT学习手册

    本系列内容来自<iText in Action 2nd>,希望有时间的读者能够自己读一遍这本书 所有的文章相关的例子:IText.7z ITEXT基础 ITEXT学习手册——创建一个简单的 ...

  5. myeclipse 10 载入新的项目报错Cannot return from outside a function or method

    myeclipse 10 载入新的项目报错Cannot return from outside a function or method 解决方法: 方法一: window -->prefere ...

  6. PS-添加前景色

    alt+Delete是填充前景色,即ps左边两个颜色块,前面的那个 ctrl+delete填充背景色

  7. cdoj 71 I am Lord Voldemort 水题

    I am Lord Voldemort Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/ ...

  8. UVA 12904 Load Balancing 暴力

    Load Balancing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/vi ...

  9. Hadoop: The Definitive Guide (3rd Edition)

    chapter 1 解决计算能力不足的问题,不是去制造更大的计算机,而是用更多的计算机来解决问题. 我们生活在一个数据的时代.“大数据”的到来不仅仅是影响到那些科研和金融机构,对小型企业以及我们个人都 ...

  10. Delphi开发OCX详细步骤总结

     首先要弄明白你要写的OCX是用在客户端还是用在服务器端    假如用在客户端: 1.创建  打开delphi 7,选择菜单"new"->"other"- ...