您的位置:首页 > 其它

获取当前请求的URL的地址、参数、参数值、各种属性

2016-02-29 15:06 726 查看
//URL: http://localhost:1897/User/Press/UserContent.aspx/9878?id=1#toc Request.ApplicationPath;    //结果: /
Request.PhysicalPath;     //结果: D:\Projects\Solution\web\User\Press\UserContent.aspx
System.IO.Path.GetDirectoryName(Request.PhysicalPath);     //结果: D:\Projects\Solution\web\User\Press
Request.PhysicalApplicationPath;     //结果: D:\Projects\Solution\web\
System.IO.Path.GetFileName(Request.PhysicalPath);     //结果: UserContent.aspx
Request.CurrentExecutionFilePath;     //结果: /User/Press/UserContent.aspx
Request.FilePath;     //结果: /User/Press/UserContent.aspx
Request.Path;     //结果: /User/Press/UserContent.aspx/9878
Request.RawUrl;     //结果:l /User/Press/UserContent.aspx/9878?id=1
Request.Url.AbsolutePath;     //结果: /User/Press/UserContent.aspx/9878
Request.Url.AbsoluteUri;     //结果: http://localhost:1897/User/Press/UserContent.aspx/9878?id=1 Request.Url.Scheme;   //结果: http
Request.Url.Host;     //结果: localhost
Request.Url.Port;     //结果: 1897
Request.Url.Authority;      //结果:localhost:1897
Request.Url.LocalPath;     //结果: /User/Press/UserContent.aspx/9878
Request.PathInfo;     //结果: /9878
Request.Url.PathAndQuery;     //结果: /User/Press/UserContent.aspx/9878?id=1
Request.Url.Query; //结果: ?id=1


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: