asp.net图片验证码
asp.net系统,在登录或注册时常提供数字或字符混合的验证码,这里介绍如何操作。
1,Default 页面
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Button2_Click(object sender, EventArgs e)
{
if (Request.Cookies["ycode"] != null)
{
if (Request.Cookies["ycode"].Value.ToString() == this.TextBox1.Text.Trim())
{
Response.Redirect("Default2.aspx");
}
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/JScript.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img id="img1" src="CreateCode.aspx" alt="点击" onclick="hp()"/>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /><br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" /></div>
&nbs
相关文档:
ASP.NET Cookies简单应用 记住用户名和密码
ASP.NET Cookies简单应用 记住用户名和密码
2009-06-11 22:45
本文转自http://www.cnblogs.com/wayne-ivan/archive/2008/12/18/1357628.html
不要试图给Password类型的TextBox赋值!
在asp.net中,不要试图给Password类型的TextBox控件赋值! 无论是在设计或是运行时 ......
这是关于Asp.Net/XML深入编程的技术书,作者精心设计了66个实例详细介绍了.Net Framework以及XML技术在.Net Framework的编程方法和技巧。全书由12章构成,内容包括.Net平台的建立、Asp.Net的Web Forms、控件、数据访问、Web Service、Asp.Net的设置和跟踪、Asp.Net的安全 ......
* Copyright all(c) 2005 ZhongFeng, http://blog.csdn.net/SW515 */
public class ValidateCode : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
this.CreateCheckCodeImage(GenerateCheckCode());
}
&nb ......
http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx?msg=3443071#xx3443071xx
ASP.NET application and page life cycle
Introduction
The Two step process
Creation of ASP.NET environment
Process request using MHPM events fired
In What event we should do what?
A sample code for demons ......