Common工具类的验证码类的使用(未实现验证)
验证码接收
- 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工具类的验证码类的使用(未实现验证)的更多相关文章
- pdo文字水印类,验证码类,缩略图类,logo类
文字水印类 image.class.php <?php /** * webrx.cn qq:7031633 * @author webrx * @copyright copyright (c) ...
- PHP常用类------生成验证码类Code
直接附上代码吧!很简单的代码,写一遍基本就会了,主要明白用GD库画图的几个步骤: 1.先创建画布,不然画在哪儿?(imagecreatetruecolor)2.根据要画的数据,选定颜色 (imagec ...
- ThinkPHP 3.2.3 加减乘法验证码类
ThinkPHP 3.2.3 自带的验证码类位于 /ThinkPHP/Library/Think/Verify.class.php,字体文件位于 /ThinkPHP/Library/Think/Ver ...
- C#工具:加密解密帮助类
using System; using System.IO; using System.Security.Cryptography; using System.Text; //加密字符串,注意strE ...
- mongoDB工具类以及测试类【java】
java操作mongo工具类 package Utils; import com.mongodb.MongoClient; import com.mongodb.MongoCredential; im ...
- 完整验证码类(validityHelper)(代码+使用)
using System; using System.Web; using System.Drawing; using System.Security.Cryptography; namespace ...
- Gif验证码类
package com.paic.bics.common.utils.vcode; import java.awt.AlphaComposite; import java.awt.Color; imp ...
- PHP-解析验证码类--学习笔记
1.开始 在 网上看到使用PHP写的ValidateCode生成验证码码类,感觉不错,特拿来分析学习一下. 2.类图 3.验证码类部分代码 3.1 定义变量 //随机因子 private $char ...
- THINKPHP源码学习--------验证码类
TP3.2验证码类的理解 今天在学习中用到了THINKPHP验证码,为了了解究竟,就开始阅读TP验证码的源码. 源码位置:./ThinkPHP/Library/Think/Verify.class.p ...
随机推荐
- HTML5 progress元素的样式控制、兼容与实例
一.progress元素基本了解 基本UIprogress元素属于HTML5家族,指进度条.IE10+以及其他靠谱浏览器都支持.如下简单code: <progress>o(︶︿︶)o< ...
- socat : Some useful commands
http://technostuff.blogspot.com/2008/10/some-useful-socat-commands.html MONDAY, OCTOBER 6, 2008 Some ...
- Educational Codeforces Round 7 A. Infinite Sequence 水题
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...
- 说说C#静态变量的诡异与恶心
发现一段很诡异的C#代码,见识了静态构造函数这种奇怪的东西: using System; namespace StaticTest { class A { public static int X; s ...
- linux C高手成长过程---书籍推荐
建议学习路径: 首先先学学编辑器,vim, emacs什么的都行. 然后学make file文件,只要知道一点就行,这样就可以准备编程序了. 然后看看<C程序设计语言>K&R,这样 ...
- js实现按回车自行提交
<script type="text/javascript"> document.onkeydown = function (e) { var theEvent = w ...
- Linux的内存回收和交换
Linux的内存回收和交换 版权声明: 本文章内容在非商业使用前提下可无需授权任意转载.发布. 转载.发布请务必注明作者和其微博.微信公众号地址,以便读者询问问题和甄误反馈,共同进步. 微博ID:or ...
- iOS iphone5屏幕适配 autosizing
转自:http://blog.sina.com.cn/s/blog_a843a8850101jxhh.html iphone5出来了,从不用适配的我们也要像android一样适配不同分辨率的屏幕了. ...
- Linux服务器集群系统(一)--转
引用地址:http://www.linuxvirtualserver.org/zh/lvs1.html LVS项目介绍 章文嵩 (wensong@linux-vs.org)2002 年 3 月 本文介 ...
- MeepoPS——轻量级 Socket 服务
MeepoPS是Meepo PHP Socket的缩写.旨在提供高效稳定的由纯PHP开发的多进程SocketService. MeepoPS可以轻松构建在线实时聊天,即时游戏,视频流媒体播放,RPC, ...