本页地址: Request.URL;

  上页地址:

  Request.UrlReferrer

  Request.ServerViables["http_referer"]

  Request.RawUrl

  Request.RawUrl.QueryAndPath

  System.IO.Path.GetFileName(Request.FilePath.ToString())

  在ASP.NET编程中经常需要用Request获取url的有关信息,Request中有多种方法获取 url信息

 Request.ApplicationPath: /testweb

  Request.CurrentExecutionFilePath: /testweb/default.aspx

  Request.FilePath: /testweb/default.aspx

  Request.Path: /testweb/default.aspx

  Request.PathInfo:

  Request.PhysicalApplicationPath: E:\WWW\testweb\

  Request.PhysicalPath: E:\WWW\testweb\default.aspx

  Request.RawUrl: /testweb/default.aspx

  Request.Url.AbsolutePath: /testweb/default.aspx

  Request.Url.AbsoluteUri: /testweb/default.aspx

  Request.Url.Host: www.test.com

  Request.Url.LocalPath: /testweb/default.aspx

  当url中带参数时可以使用:

  HttpContext.Current.Request.Url.PathAndQuery.ToString()

posted on 2011-02-10 13:05  专注NET开发  阅读(186)  评论(0编辑  收藏  举报