验证码接收

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. VC、MFC中设置控件的背景色、标题、字体颜色、字体要注意的地方[转]

    在MFC中设置控件的背景色.字体.字体颜色.标题等属性主要是利用OnCtlColor函数来实现. 如: HBRUSH CAlarm::OnCtlColor(CDC* pDC, CWnd* pWnd, ...

  2. js 中使用工厂方法和构造器方法

    1 直接创建对象 <!DOCTYPE html> <html> <head lang="en"> <meta charset=" ...

  3. 动态链接库 仅有.dll文件时候的使用方法

    在没有.h和.lib文件时,需要函数指针和WIN32 API函数 LoadLibrary, GetProcAddress 和FreeLibrary 只需要.dll文件即可(将.dll文件置入工程目录中 ...

  4. c#(asp.net)杂谈笔记

    1.js解析json格式的时间 //转换json格式时间的方法 如Date(1340239979000)转换为正常 function ConvertJSONDateToJSDateObject(JSO ...

  5. Java和C++中多态的实现方式

    多态是面向对象的最主要的特性之一,是一种方法的动态绑定,实现运行时的类型决定对象的行为.多态的表现形式是父类指针或引用指向子类对象,在这个指针上调用的方法使用子类的实现版本.多态是IOC.模板模式实现 ...

  6. 摘录知乎上关于android开发的话题精华

    1.初学者学习 Android 开发,有什么好网站推荐? http://www.zhihu.com/question/19611325 2.Android 开发有哪些新技术出现? http://www ...

  7. SQLSERVER备份事务日志的作用

    事务日志备份有以下3种类型 (1)纯日志备份:仅包含相隔一段时间的事务日志记录,而不包含任何大容量更改 (2)大容量操作日志备份.包括由大容量操作更改的日志和数据页,不支持时间点恢复 (3)尾日志备份 ...

  8. 你真的了解javascript吗

    原文地址:http://dmitry.baranovskiy.com/post/91403200 看了文章中五个小例子,写了写自己的理解 #demo1 if (!("a" in w ...

  9. purge

    RR级别 mysql V5.6 debug ; 测试1 会话1: mysql)); Query OK, rows affected (0.04 sec) mysql,"a"); Q ...

  10. C++检测一个文件是否存在

    ifstream::is_open - C++ Reference http://www.cplusplus.com/reference/fstream/ifstream/is_open/ // if ...