62,074
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
using System.Text.RegularExpressions;
using ATA.OLSD.Common;
using ATA.OLSD.OrgMng.Entity;
namespace ATA.OLSD.OrgMng.Common
{
public class BagePage : System.Web.UI.Page, ATA.OLSD.OrgMng.Common.ITransfer
{
public ATA.OLSD.OrgMng.Entity.TransferClass _TransferObject;
ATA.OLSD.Common.RijndaelEncrypt encrypt = new ATA.OLSD.Common.RijndaelEncrypt();
/// <summary>
/// 机构类型枚举
/// </summary>
public enum OrganizationType
{
ATA_Admin = 1,
zyzx,
cbjg1,
cbjg2,
pxjg,
pxd
};
public BagePage()
{
_TransferObject = new ATA.OLSD.OrgMng.Entity.TransferClass();
}
public TransferClass TransferObject
{
get
{
return this._TransferObject;
}
set
{
this._TransferObject = value;
}
}
protected override void OnInit(EventArgs e)
{
// 这里就有校验session的代码
try
{
base.OnInit(e);
//this.Error += new EventHandler(Page_Error);
if (Session == null || Session.Count == 0 || Session["UserCode"] == null)
{
if (Request.Url.ToString().ToUpper().IndexOf("LOGIN.ASPX") != -1
|| Request.Url.ToString().ToUpper().IndexOf("LOGOUT.ASPX") != -1
|| Request.Url.ToString().ToUpper().IndexOf("ATALOGIN.ASPX") != -1)
{
return;
}
//else
//HttpCookie UrlCook = Request.Cookies["AURL"];
//if (UrlCook != null)
//{
// //Response.Redirect("");
//}
RedirectToLogin();
}
//else
//{
// Redirec
// if (!CheckRightWithInPage())
// {tToLogin();
// }
//}
}
catch (Exception ex)
{
Log log = new Log("File_Log");
log.Error(ex.Message);
}
}
}
void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码
}
void Application_End(object sender, EventArgs e)
{
//在应用程序关闭时运行的代码
}
void Application_Error(object sender, EventArgs e)
{
//在出现未处理的错误时运行的代码
}
void Session_Start(object sender, EventArgs e)
{
//在新会话启动时运行的代码
if(Session["xxxx"]==null){
Reponse.Redirect("Login.aspx");
}
}
void Session_End(object sender, EventArgs e)
{
//在会话结束时运行的代码。
// 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
// InProc 时,才会引发 Session_End 事件。如果会话模式
//设置为 StateServer 或 SQLServer,则不会引发该事件。
}
void Application_BeginRequest(object sender, EventArgs e)
{
Context.Items["BeginRequestTickCount"] = A.GetTickCount();
}