登陆密码错误 数据库里的用户和密码明明都是对的 怎么破怎么破 跪求大神帮助

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Bll;
using Web.Mod;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
    //login
    try
    {
        string name = TextBox1.Text.Trim();
        string pass = TextBox2.Text.Trim();

        Admin a = AdminMananger.GetByName(name);
        if (a == null || a.Pass != pass)
            Response.Write("<script>alert('用户名或密码错误!');</script>");
        else
        {
            Session["admin"] = a;
            Response.Redirect("Main.aspx");
        }
    }
    catch {
        Response.Write("<script>alert('用户名或密码错误!');</script>");
    }
}

protected void Button2_Click(object sender, EventArgs e)
{
    this.TextBox1.Text = "";
    TextBox2.Text = "";
}

}

net

1个回答

AdminMananger.GetByName的代码呢

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐