|
I wrote a verification code generation face, and then use the image control in the place where I log in, realistically, but when I log in the verification code is wrong, you can log in, what's going on, thank you!
The code judged by my session:
if (Session ["checkCode"]. ToString ()! = validaor.Text.ToString ())
{
lbMessage.Visible = true;
lbMessage.Text = "Wrong verification code!";
}
Validate page code.
protected void Page_Load (object sender, EventArgs e)
{
if (! Page.IsPostBack)
{
string checkCode = CreateRandomCode (4);
Session ["CheckCode"] = checkCode;
CreateImage (checkCode);
}
} |
|