Project.WebUi/Login.aspx.cs

(开头部分) 2KB

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

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Project.Model;
using Project.Bll;
using Project.Common;
//下载于51aspx.com
namespace Project.WebUi
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        //登陆
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string uName = this.txtAdminName.Text.Trim();
            string uPwd = this.txtAdminPwd.Text.Trim();
            string vCode = this.txtVcode.Text.Trim().ToLower();
            string code = Session["vcode"] == null ? "" : Session["vcode"].ToString().Trim().ToLower();
            if (vCode == "" || vCode != code)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('验证码错误!');</script>");
                return;
            }

            UserInfoBll bll = new UserInfoBll();
            UserInfo model = bll.GetModel(uName, CommonFun.GetMD5(uPwd));
            if (model != null)
            {
                if (model.IsLock == 1)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('帐户被锁定,不能登陆,请与管理员联系!');</script>");
                    return;
                }
                else
                {
                    LoginUserInfo user = new LoginUserInfo();
                    user.UserId = model.UserId;
                    user.UserName = model.UserName;
                    user.RoleId = model.RoleId;

                    CommonFun.UserLoginSetCookie(user.UserName, this.Page, DateTime.Now.AddMinutes(30), user);
                    Response.Write("<script type='text/javascript'>window.location = 'Default.aspx'</script>");
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('用户名或密码错误!');</script>");
后面还有 5 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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