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());
}
查看全文
相关阅读:
比较实用的免费图标字库(转)
聊聊 cursor鼠标样式
(转)3款优秀的移动webAPP网站在线测试工具
常用meta整理
(转)SVN搭建(附下载地址)
(转)C#串口SerialPort常用属性方法
加载信息,先从数据库取出5条实现分页,鼠标向上滑动触发Ajax再加载5条,达到异步刷新,优化加载。。。
图片上传,获取路径以及下载功能
Mysql事务,并发问题,锁机制
app中Webview实现下载表格
原文地址:https://www.cnblogs.com/yvesliao/p/858612.html
最新文章
Rotate List —— LeetCode
Divide Two Integers —— LeetCode
Subsets —— LeetCode
Jump Game —— LeetCode
Redis源码阅读笔记(1)——简单动态字符串sds实现原理
Evaluate Reverse Polish Notation——LeetCode
Reverse Words in a String——LeetCode
使用UI管理docker
collectd 检测cpu使用率
tensorflow 学习
热门文章
curl 用法总结
k8s build new API
k8s API sample
centos install go
yum all installed dependent packages while removing a package in centos 7?
intel webrtc 部署
tensorflow intel platform 优化
(转)处理SQL中的异常并记录错误日志
(转)CSS3:nth-child()伪类选择器,奇偶数行自定义样式first-child
网页布局之---固定布局、流动布局、弹性布局(转)
Copyright © 2011-2022 走看看