HttpRequest 對象 Request獲取虛擬路徑和物理路徑的屬性或方法

HttpRequest 對象 Request獲取虛擬路徑和物理路徑的屬性或方法

請求的URL; http://localhost/DataProcess/HttpRequest.aspx?name=Tony

顯示頁面:

Request["name"]=Tony
Request.AppllicationPath=/DataProcess   
虛擬應用程序路徑
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

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章