BookShop/BasePage.cs
(开头部分) 16KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using CTL.Common;
namespace BookShop
{
public class BasePage : Page
{
public Model.Admin adminInfo = null;
protected override void OnInit(EventArgs e)
{
adminInfo = GetAdminInfoByCookie();
if (adminInfo == null)
{
Response.Redirect("Login.aspx");
}
}
/// <summary>
/// 通过Cookie信息获取管理员信息
/// </summary>
/// <returns></returns>
public Model.Admin GetAdminInfoByCookie()
{
HttpCookie cookie = Cookie.Get("admin");
Model.Admin model = null;
if (cookie == null || cookie.Values["name"] == "" || cookie.Values["key"] == "")
{
return null;
}
else
{
string name = cookie.Values["name"];
string pwd = cookie.Values["key"];
model = AdminBLL.GetAdminInfoByCondition("AdminName='" + name + "'");
if (model == null)
{
return null;
}
else
{
if (model.Password != pwd)
{
return null;
}
else
{
return model;
}
}
}
后面还有 231 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。