baseispadminpage.cs
来自「完全网站系统」· CS 代码 · 共 39 行
CS
39 行
namespace ASPNET.StarterKit.Communities {
using System;
using System.Web;
using System.Web.UI;
// *********************************************************************
//
// BaseISPAdminPage Class
//
// This class handles security for all the ISP Admin pages.
// All the ISPAdmin pages derive from this class.
//
// *********************************************************************
public class BaseISPAdminPage : Page {
override protected void OnInit(EventArgs e) {
base.OnInit(e);
// Check security
if (Request.Cookies["ISPAdmin"] == null)
Response.Redirect("~/ISPAdmin/IspLogin.aspx");
// Get the username and password from session cookies
string username = Request.Cookies["ISPAdmin"].Values["Username"];
string password = Request.Cookies["ISPAdmin"].Values["Password"];
// if bad username or password, redirect
if (username.ToLower() != CommunityGlobals.IspUsername.ToLower() || password.ToLower() != CommunityGlobals.IspPassword.ToLower())
Response.Redirect("~/ISPAdmin/IspLogin.aspx");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?