jiankangfuwu/Login.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

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

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string zhanghao = this.zhanghao.Text;//获取登录帐号
        string mima = this.mima.Text;//获取登录密码
        if (zhanghao == "") 
        {
            MessageBox.Show(this,"登录帐号不能不空");
            return;
        }
        if (mima == "")
        {
            MessageBox.Show(this, "登录密码不能不空");
            return;
        }
            DataTable tb = DbSQL.GetQuery("select * from  admin where zhanghao='" + this.zhanghao.Text + "'and mima='" + this.mima.Text.Trim() + "'");
            if (tb.Rows.Count > 0)
            {
                Session["id"] = tb.Rows[0]["id"].ToString();//保存ID在session中
                Session["zhanghao"] = tb.Rows[0]["zhanghao"].ToString();
                Session["mima"] = tb.Rows[0]["mima"].ToString();
                Response.Redirect("Admin/Default.aspx");//跳转到管理员主页面
            }
            else
            {
                MessageBox.Show(this, "登录帐号或密码错误!");
                return;
            }

    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。