首页 > 代码库 > url重写(form www.sysoft.cc)

url重写(form www.sysoft.cc)

简单的url重写,静态化前身,在global.asa中的begin_request事件中添加

protected void Application_BeginRequest(Object sender, EventArgs e)        {            string url = Request.AppRelativeCurrentExecutionFilePath;//"~/play_15.aspx"            Match match = Regex.Match(url, @"~/Play_(\d+).aspx");            if (match.Success)            {                int id = Convert.ToInt32(match.Groups[1].Value);                Context.RewritePath("play.aspx?id=" + id);            }        }

  

url重写(form www.sysoft.cc)