Web/UserControl/login.ascx.cs
(完整代码) 1KBusing 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 UserControl_login : System.Web.UI.UserControl
{
Model.tab_customers modelCu = new Model.tab_customers();
Bll.CustomerBll Cb = new Bll.CustomerBll();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Submit1_ServerClick1(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
if (this.TextBox1.Text !="" && this.TextBox2.Text !="")
{
if (StrSecurity.CheckStr(this.TextBox1.Text+this.TextBox2.Text) == false)
{
Response.Write("<script>alert('用户提交非法字符')</script>");
return;
}
modelCu.customerName = this.TextBox1.Text;
modelCu.customerPwd = this.TextBox2.Text;
DataTable dt = Cb.CustomerSelect(modelCu);
if (dt.Rows.Count > 0)
{
Session["cus"] = dt.Rows[0]["customerName"];
Session["id"] = dt.Rows[0]["customerID"];
this.Panel1.Visible = false;
this.Panel2.Visible = true;
this.Label1.Text = Session["cus"].ToString();
//Response.Write("<script>alert('登陆成功')</script>");
}
else
{
Response.Write("<script>alert('用户名或则密码错!!')</script>");
}
}
else
{
Response.Write("<script>alert('用户名或则密码为空')</script>");
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
