⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pagebase.cs

📁 用vs2005写的一个生产任务管理系统。数据的统计和综合查询是主要功能
💻 CS
字号:
using System; 

namespace RWSB
{
	/// <summary>
	/// PageBase 的摘要说明。
	/// </summary>
	public class PageBase :System.Web.UI.Page 
	{
		private string moduleID;
		public string ModuleID
		{
			get
			{
				return this.moduleID;
			}
			set
			{
				if(value!=null)
				{
					this.moduleID=RWSB.Modules.String.GenSafeChars(value);
					//this.ValidateUser(this.moduleID);
				}
			}
		}	
		public PageBase()
		{
		}
		public PageBase(string ModuleID)
		{
			this.ModuleID=ModuleID;
			//this.ValidateUser(this.ModuleID);

			
		}
		protected void PageBase_Init(object sender,System.EventArgs e)
		{
	
			string URL="HTTP://"+Request.ServerVariables["HTTP_HOST"]+Request.ApplicationPath+"/login.aspx";
			/*if(Session["userid"]==null)
			{
				Response.Write("<script>alert('使用超时,请用户重新登陆!');window.location.href='"+URL+"';</script>") ;
			}*/
			
			
		}
		protected override void OnInit(EventArgs e)
		{
			this.Error+=new EventHandler(PageBase_Error);
			this.Init+=new EventHandler(PageBase_Init);
			base.OnInit (e);

		}
		private void PageBase_Error(object sender, System.EventArgs e)
		{
			System.Exception err = Server.GetLastError();
			if(!(err is AppException))
			{
				string errmsg=err.Message+"\n\r"+err.StackTrace;
				if(err.InnerException !=null)
				{
					errmsg="\n\r"+err.InnerException.Message+err.StackTrace;
				}
				RWSB.Modules.ErrorLog.WriteLog(Request.Url.ToString(),errmsg);				
			}
			Server.ClearError();
			Response.Redirect(RWSB.Modules.Config.GetSetting("errPage"));
		}
		/// <summary>
		/// 将字符串转换为安全html标记
		/// </summary>
		/// <param name="SourceString">目标字符串</param>
		/// <returns></returns>
		public  string GenSafeHtmlString(string SourceString)
		{
			if(SourceString!=null)
				SourceString=this.Server.HtmlEncode(SourceString).Replace("\n","<br/>");
			return SourceString;
		}
		

	}
}

⌨️ 快捷键说明

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