📄 baseispadminpage.cs
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -