YKT_EShop/_Template/Default/login.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YKT_Common;
using YKT_BLL;
using YKT_Model;
using System.Web.Security;

namespace YKT_EShop._Template.Default
{
    public partial class login : BasicPage
    {
        private string returnUrl = "";
        protected Button btnLogin;
        protected TextBox txtUserName;
        protected TextBox txtUserPwd;
        protected CheckBox chkremember;
        protected void Page_Load(object sender, EventArgs e)
        {
            returnUrl = Input.SetString(Request["returnurl"]);
        }

        private void InitializeComponent()
        {
            this.btnLogin.Click += new EventHandler(btnLogin_Click);
        }

        void btnLogin_Click(object sender, EventArgs e)
        {
            DateTime time = DateTime.Now.AddHours(1);
            string userName = this.txtUserName.Text;
            string userpwd = this.txtUserPwd.Text;
            if (userName == "")
            {
                Js.AlertAndGoHistory("用户名称不能为空!", -1);
                return;
            }
            if (userpwd == "")
            {
                Js.AlertAndGoHistory("用户密码不能为空!", -1);
                return;
            }
            if (this.chkremember.Checked)
            {
                time = DateTime.Now.AddDays(1);
            }
            BLLUser bll = new BLLUser();
            ModelUser model = new ModelUser();
            model.UserName = userName;
            model.UserPassword = Input.MD5(userpwd, 16);
            model = bll.UserLogin(userName, Input.MD5(userpwd, 16));
            if (model != null)
            {
                //添加cookies 加密cookies
                HttpCookie cookie = new HttpCookie("LoginStatus");
                cookie.Values.Add("account", model.UserName);
                cookie.Values.Add("pass", model.UserPassword);
后面还有 32 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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