最简单的密码验证asp.net c#
作者:互联网
protected void Button1_Click(object sender, EventArgs e)
{
string bh = this.TextBox1.Text.Trim();
string pass = this.TextBox2.Text.Trim();
DataTable dt = new olecado().ruibomima(bh, pass);
if (dt.Rows.Count > 0)
{
Session["kk"] = this.TextBox1.Text.ToString().Trim();
Response.Redirect("gllist.aspx");
}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('编码或密码错误,请联系管理员!');</script>");
return;
}
}
标签:Trim,asp,string,c#,Text,TextBox1,pass,net,Page 来源: https://www.cnblogs.com/houweidong/p/12263268.html