http://127.1.1.1/dm/image/test.aspx?id=12&role=12%2cac
Request.Url.AbsoluteUri
/dm/image/test.aspx
Request.ServerVariables["URL"];
Request.CurrentExecutionFilePath;
127.1.1.1
Request.ServerVariables["HTTP_HOST"];
Request.Url.Host;
/dm
Request.ApplicationPath;
80(端口)
Request.Url.Port.ToString();
---------------------以下部分为摘录http://www.xue5.com/itedu/200802/105898.html------------------------------
HttpRequest 对象 Request获取虚拟路径和物理路径的属性或方法
请求的URL; http://localhost/DataProcess/HttpRequest.aspx?name=Tony
显示页面:
Request.FilePath=/DataProcess/HttpRequest.aspx 文件的虚拟路径
Request.Headers=Connection=Keep-Alive&Accept=*%2f*&Accept-Encoding=gzip%2c+deflate&Accept-Language=zh-cn&Cookie=username%3dadmin%3b+password%3dnihao%3b+recheck%3dT%3b+ASP.NET_SessionId%3d1iebaa55jqdfco55jkmb5055&Host=localhost&User-Agent=Mozilla%2f4.0+(compatible%3b+MSIE+6.0%3b+Windows+NT+5.1%3b+SV1%3b+.NET+CLR+1.1.4322) 一个HTTp标题的集合
Request.Path=/DataProcess/HttpRequest.aspx 请求的虚拟路径
Request.PhysicalApplicationPath=F:/ex/web(net)/DataProcess/ 应用程序的物理路径
Request.PhysicalPath=F:/ex/web(net)/DataProcess/HttpRequest.aspx 请求的物理路径
Request.RawUrl=/DataProcess/HttpRequest.aspx?name=Tony 请求的原始Url
Request.Url=http://localhost/DataProcess/HttpRequest.aspx?name=Tony 包含详细请求信息的Url
Request.UserHostAddress=127.0.0.1
Request.UserHostName=127.0.0.1
Server.MapPath()=F:/ex/web(net)/DataProcess 根据虚拟路径可以返回其物理路径
Server.MachineName=XY