asp.net c#语言 生成的验证码如何进行验证
protectedvoidPage_Load(objectsender,EventArgse){intop;intop2;ints;Randomrnd=newRandom...
protected void Page_Load(object sender, EventArgs e)
{
int op;
int op2;
int s;
Random rnd = new Random();
op = rnd.Next(0, 10);
op2 = rnd.Next(0,10);
Session["coke"] = (op + op2).ToString();
Label5.Text = op.ToString() + "+" + op2.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox3.Text == (string)(Session["coke"]))
{
Button1.UseSubmitBehavior = false;
Response.Write("dui");
}
else
{
Button1.UseSubmitBehavior = false;
Response.Write("cuo");
}
}
当点击button1的时候就晕从page_lond那重新开始运行这样验证码就会重新取两个数,在做好验证码之后怎么样让他参与验证。验证码改怎么写! 展开
{
int op;
int op2;
int s;
Random rnd = new Random();
op = rnd.Next(0, 10);
op2 = rnd.Next(0,10);
Session["coke"] = (op + op2).ToString();
Label5.Text = op.ToString() + "+" + op2.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox3.Text == (string)(Session["coke"]))
{
Button1.UseSubmitBehavior = false;
Response.Write("dui");
}
else
{
Button1.UseSubmitBehavior = false;
Response.Write("cuo");
}
}
当点击button1的时候就晕从page_lond那重新开始运行这样验证码就会重新取两个数,在做好验证码之后怎么样让他参与验证。验证码改怎么写! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询