📄 userlogin.ascx.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 UserLogin : System.Web.UI.UserControl
{
protected void ibtnLogin_Click(object sender, ImageClickEventArgs e)
{
if (Session["ValidateCode"].ToString().ToLower() == txtCheck.Text.ToLower().Trim())
{
string password = PasswordHasher.Hash(txtPwd.Text.Trim());
if (CommonDataAccess.IsCustomerExsist(txtUserName.Text.Trim(), password))
{
Session.Remove("ValidateCode");
Session["customer"] = txtUserName.Text.Trim();
Response.Redirect("UserCenter.aspx");
}
else
{
Message.ShowMsgBox(Page, "用户名或密码错误!");
}
}
else
{
Message.ShowMsgBox(Page, "验证码错误!");
txtCheck.Text = null;
}
}
protected void ibtnRegister_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("UserReg.aspx");
}
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Customer"] != null)
{
Panel1.Visible = false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -