zoukankan
html css js c++ java
中文图片验证码
功能是生成图片,并把图片中的文字保存在Session中,
源代码下载
新建一个Aspx文件用来提供验证码图片,例如:ValidCode.aspx,PageLoad加上此事件
protected
void
Page_Load(
object
sender, EventArgs e)
{
Session[
"
ValidCode
"
]
=
Socansoft.ValidCode.CreateImage(
4
, Socansoft.ValidCode.ValidType.Numeric);
}
此页面就是提供图片源的页面了,测试一下,前台HTML
<
asp:Image
ID
="Image1"
runat
="server"
ImageUrl
="/WebBBS/ValidCode.aspx"
/>
<
asp:TextBox
ID
="TextBox1"
runat
="server"
></
asp:TextBox
>
<
asp:Button
ID
="Button1"
runat
="server"
OnClick
="Button1_Click"
Text
="Button"
/></
div
>
后台代码
protected
void
Button1_Click(
object
sender, EventArgs e)
{
bool
b
=
TextBox1.Text
==
Session[
"
ValidCode
"
].ToString();
Response.Write(b.ToString());
}
查看全文
相关阅读:
随笔:金融的“游戏”规则——游戏世界的区块链喵与现实世界的金融科技
js实现链表
事件
JQ操作DOM
JQuery选择器
AJAX
file
表单
DOM
window&navigator&screen&location
原文地址:https://www.cnblogs.com/yvesliao/p/858612.html
最新文章
html5[1]:优化Android Webview性能
How to change statusbar text color to dark on android 4.4
系统设计原则
js 对象常用扩展
linux安装FastDFS
linux 下 安装 vsftpd
centOs7 使用firewalld防火墙
secureCRT
linux 安装 redis
linux 安装 nginx
热门文章
Attribute特性验证模型model
并行编程(一)
核心银行系统 系列文章 已搬家至简书更新
随笔:核心银行系统 之六 贷款(一)
随笔:核心银行系统 之五 7 X 24小时 不间断运行的核心系统设计
随笔:核心银行系统 之四 核心系统的落地过程-“换心之旅”
随笔:核心银行系统 之三 核心系统的国内外厂商介绍
随笔:核心银行系统 之二 核心业务模块介绍
随笔:核心银行系统 之一 核心的发展历史
项目管理 之 IT与业务——角色 “互补”
Copyright © 2011-2022 走看看