__7 2016-05-21 05:22 采纳率: 0%
浏览 1519

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

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 = "";
}

}

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-05-21 05:36
    关注

    AdminMananger.GetByName的代码呢

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog