global.asax.cs

来自「。net 同学录。非要写20个字才让发」· CS 代码 · 共 77 行

CS
77
字号
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace txl 
{
	/// <summary>
	/// Global 的摘要说明。
	/// </summary>
	public class Global : System.Web.HttpApplication
	{
		public Global()
		{
			InitializeComponent();
		}	
		
		protected void Application_Start(Object sender, EventArgs e)
		{

		}
 
		protected void Session_Start(Object sender, EventArgs e)
		{

		}

		protected void Application_BeginRequest(Object sender, EventArgs e)
		{
			Application["StartTime"] = System.DateTime.Now;

		}

		protected void Application_EndRequest(Object sender, EventArgs e)
		{
			
			System.DateTime startTime = (System.DateTime)Application["StartTime"];
			System.DateTime endTime = System.DateTime.Now;
			System.TimeSpan ts = endTime - startTime;
			Response.Write("<table border=0' width='100%'><tr><td align='center' width='100%'><img border='0' src='image/power.gif'></td></tr><tr><td align='center' width='100%'><font size=1 color='Silver'>页面执行耗时:" + ts + "秒<font></td></tr></table>");

		}

		protected void Application_AuthenticateRequest(Object sender, EventArgs e)
		{

		}

		protected void Application_Error(Object sender, EventArgs e)
		{

		}

		protected void Session_End(Object sender, EventArgs e)
		{

		}

		protected void Application_End(Object sender, EventArgs e)
		{

		}
			
		#region Web Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
		}
		#endregion
	}
}

⌨️ 快捷键说明

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