Login.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using MyWeb.DBUtility;
using MyWeb.WebUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyWeb
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["id"] = null;
                Session["name"] = null;
            }
        }
        protected void btn_login_ServerClick(object sender, EventArgs e)
        {
            DBHelper db = new DBHelper();
            WebHelper wb = new WebHelper();
            if (Account.Value == "")
            {
                wb.Alert("账号不能为空!");
            }
            else if (Password.Value == "")
            {
                wb.Alert("密码不能为空!");
            }
            else if (VCode.Value == "")
            {
                wb.Alert("验证码不能为空!");
            }
            else if (VCode.Value != Session["check_code"].ToString())
            {

                wb.Alert("验证码输入错误!");
            }
            else
            {
                string sql = "select id,name from UserInfo_Tbl where del=0 and isAudit=1 and account='" + Account.Value + "' and password='" + Password.Value + "'";
                DataSet ds = db.Query(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Session["id"] = ds.Tables[0].Rows[0]["id"];
                    Session["name"] = ds.Tables[0].Rows[0]["name"];
                    Session["user"] = 1;
                    Session["type"] = "普通用户";
                    wb.Alert("登陆成功", "HomePage.aspx");
                }
                else
                {
                    wb.Alert("登陆失败,请检查账号和密码是否正确或本账号已被冻结!");
                }
            }
后面还有 3 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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