Monday, January 25, 2010

view.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class view : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (DropDownList1.SelectedValue)
{
case "1":
Image1.ImageUrl = "png.aspx?aa=1";
break;
case "2":
Image1.ImageUrl = "png.aspx?aa=2";
break;
case "3":
Image1.ImageUrl = "png.aspx?aa=3";
break;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
if (TextBox1.Text == Session["gif"].ToString())
Response.Write("OK,正确");
else
Response.Write("验证码不符合");
}
}

No comments:

Post a Comment