Backup/Global.asax.cs

(开头部分) 3KB

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

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

namespace IndiaStudyChannel 
{
	/// <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)
		{

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

		}

		protected void Application_BeginRequest(Object sender, EventArgs e)
		{
            HttpContext incoming  = HttpContext.Current;
            string pageId;

            if (System.IO.Path.GetExtension(incoming.Request.Path.ToLower()) != ".aspx")
            {
                return;
            }

            System.Text.RegularExpressions.MatchCollection matches;

            matches = GetMatches("/colleges/(\\d+)(.*).aspx");
            if (matches.Count > 0)
            {
                pageId = matches[0].Groups[1].ToString();
                incoming.RewritePath("/colleges/CollegeDetails.aspx?CollegeId=" + pageId);
                return;
            }

            matches = GetMatches("/universities/(\\d+)(.*).aspx");
            if (matches.Count > 0)
            {
                pageId = matches[0].Groups[1].ToString();
                incoming.RewritePath("/universities/UniversityDetails.aspx?UniversityId=" + pageId);
                return;
后面还有 53 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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