Web/Admin/Login.aspx.cs

(开头部分) 4KB

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

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

namespace cosmos.Web.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        cosmos.BLL.Admin bll = new BLL.Admin();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.ViewState["GUID"] = System.Guid.NewGuid().ToString();
                this.lblGUID.Text = this.ViewState["GUID"].ToString();
            }
        }

        protected void logindl_Click(object sender, ImageClickEventArgs e)
        {
            if ((Session["CheckCode"] != null) && (Session["CheckCode"].ToString() != ""))
            {
                #region 记录登录次数
                if (Session["AdminLoginSun"] == null)
                {
                    Session["AdminLoginSun"] = 1;
                }
                else
                {
                    Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
                }
                //判断登录
                if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 3)
                {
                    this.logindl.Enabled = false;
                    this.txtCode.Text = "";
                    this.txtName.Enabled = false;
                    this.txtPwd.Enabled = false;
                    this.lblMsg.Text = "对不起,你错误登录了三次,系统登录锁定!";
                }
                #endregion

                string UserName = txtName.Text.Trim();
                string UserPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtPwd.Text.ToString(), "MD5");
                if (UserName.Equals("") || UserPwd.Equals(""))
                {
                    lblMsg.Text = "请输入您要登录用户名或密码";
                }
                else
                {
                    //if (Session["CheckCode"].ToString().ToLower() != this.txtCode.Text.ToLower())
                    //{
                    //    this.lblMsg.Text = "您输入的验证码不正确,请重新输入!";
                    //    this.txtCode.Text = "";
                    //    Session["CheckCode"] = null;
后面还有 49 行代码,购买后查看完整代码

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

AI 解读 AI

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

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