Global.asax.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace RBBBS 
{
	/// <summary>
	/// Summary description for Global.
	/// </summary>
	public class Global : System.Web.HttpApplication
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		public Global()
		{
			InitializeComponent();
		}	
		
		protected void Application_Start(Object sender, EventArgs e)
		{
			Application["user_sessions"]=0;
			Application["count"]=0;

		}
 
		protected void Session_Start(Object sender, EventArgs e)
		{
			Application.Lock();
			Application["user_sessions"] = (int)Application["user_sessions"] + 1;
			//判断当前有几个人在线,然后赋值到Application["user_sessions"]变量.
			Application.UnLock();
			//数据库连接
			Session["str_connection"]=System.Configuration.ConfigurationSettings.AppSettings["Connectionstring"];


		}

		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' bgcolor='#ffffff'  width='100%'><tr><td height='20' align='center' width='100%'><font size=1 color='Silver'>页面执行耗时:" + ts + "秒<font></td></tr></table>");


		}

		protected void Application_AuthenticateRequest(Object sender, EventArgs e)
		{
后面还有 35 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。