LK.Shop.Web/Manager/Index.aspx.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LK.Shop.Common;

namespace LK.Shop.Web.Manager
{
    public partial class Index : System.Web.UI.Page
    {
        LK.Shop.BLL.ManagerInfo managerInfoBll = new BLL.ManagerInfo();
        LK.Shop.Model.ManagerInfo managerInfoModel = new Model.ManagerInfo();
        private string vAct;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["Act"] != null && Request.QueryString["Act"].Trim() != "")
            {
                vAct = Request.QueryString["Act"].Trim();
            }
            else
            {
                vAct = "";
            }
            if (vAct == "loginout") {
                Response.Cookies["ShopManagerInfo"]["51ShopManagerName"] = null;
                base.Response.Cookies["ShopManagerInfo"]["51ShopManagerPwd"] = null;
                Response.Redirect("index.aspx");
            }
        }

        protected void Button_Login_Click(object sender, EventArgs e)
        {
            if (ValidateValue())
            {
                string userName = base.Request.Form["txtUserName"].ToString();
                string userPwd = base.Request.Form["txtUserPass"].ToString();
                userPwd = LK.Shop.Common.MD5Util.GetMD5(userPwd, "UTF-8");
                if ((userName == "") || (userPwd == ""))
                {
                    base.Response.Redirect("Index.aspx");
                }
                else if (managerInfoBll.Exists(userName) && managerInfoBll.ValidateUser(userName, userPwd))
                {
                    managerInfoModel = managerInfoBll.GetModel(userName);
                    if (managerInfoModel != null)
                    {
                        string a = LK.Shop.Common.Cookies.Encrypt(userName, LK.Shop.Common.Cookies.myKey);
                        base.Response.Cookies["ShopManagerInfo"]["51ShopManagerName"] = LK.Shop.Common.Cookies.Encrypt(userName, LK.Shop.Common.Cookies.myKey);
                        base.Response.Cookies["ShopManagerInfo"]["51ShopManagerPwd"] = LK.Shop.Common.Cookies.Encrypt(userPwd, LK.Shop.Common.Cookies.myKey);
                        base.Response.Cookies["ShopManagerInfo"].Expires = DateTime.Now.AddYears(1);
                        managerInfoModel.ManagerLoginDate = DateTime.Now;
                        managerInfoModel.ManagerName = userName;

                        Response.Redirect("Main.aspx");
                    }
                    else
                    {
                        JScript.AlertAndRedirect("用户名或密码错误!","index.aspx");
后面还有 34 行代码,购买后查看完整代码

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

AI 解读

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

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