authorizablepage.cs

来自「《精通ASP.NET2.0网络应用系统开发》书中的源码」· CS 代码 · 共 28 行

CS
28
字号
using System;

namespace webvisitStatistic 
{
	/// <summary>
	/// AuthorizablePage 的摘要说明。
	/// </summary>
	public class AuthorizablePage : System.Web.UI.Page
	{
		override protected void OnInit(EventArgs e)
		{
			String userName;
			SessionHelp.GetUserStatus(Session ,out userName);
			if (null==userName) 
			{
				RedirectToUnAuthorize();
			}
			// base init
			base.OnInit(e);
		}

		protected virtual void RedirectToUnAuthorize()
		{
			Response.Redirect("Login.aspx");
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?