2024年4月6日 星期六

ASP.NET內抓取網址的方式一覽表(Request)

 


Request.ApplicationPath /

Request.Url.Host my.url.com

Request.Url.Port 8080

Request.Url.Scheme https

Request.Url.Authority my.url.com:8080

Request.Path /Detail/Page/List.aspx/showmore

Request.Url.LocalPath /Detail/Page/List.aspx/showmore

Request.PathInfo /showmore

Request.Url.Query ?mid=20

Request.CurrentExecutionFilePath /Detail/Page/List.aspx

Request.FilePath /Detail/Page/List.aspx

Request.RawUrl /Detail/Page/List.aspx/showmore?mid=20

Request.Url.PathAndQuery /Detail/Page/List.aspx/showmore?mid=20

Request.Url.AbsoluteUri https://my.url.com:8080/Detail/Page/List.aspx/showmore?mid=20

Request.Url.AbsolutePath /Detail/Page/List.aspx/showmore


-----------



  Request.ApplicationPath

 //output:/

 

 Request.PhysicalPath

 //output:磁碟機代號:\父目錄\子目錄\Default3.aspx

 

 System.IO.Path.GetDirectoryName(Request.PhysicalPath)

 //output:磁碟機代號:\父目錄\子目錄

 

 Request.PhysicalApplicationPath

 //output:磁碟機代號:\父目錄\子目錄\

 

 System.IO.Path.GetFileName(Request.PhysicalPath)

 //output:Default3.aspx

 

 Request.CurrentExecutionFilePath

 //output:/Default3.aspx

 

 Request.FilePath

 //output:/Default3.aspx

 

 Request.Path

 //output:/Default3.aspx

 

 Request.RawUrl

 //output:/Default3.aspx?id=1019&uu=77

 

 Request.Url.AbsolutePath

 //output:/Default3.aspx

 

 Request.Url.AbsoluteUri

 //output:http://demo.tc/Default3.aspx?id=1019(這是上一頁的網址)

 

 Request.Url.Scheme

 //output:http

 

 Request.Url.Host

 //output:demo.tc

 

 Request.Url.Port

 //output:80

 

 Request.Url.Authority

 //output:demo.tc

 

 Request.Url.LocalPath

 //output:/Default3.aspx

 

 Request.PathInfo     

 //output:

 

 Request.Url.PathAndQuery

 //output:/Default3.aspx?id=1019&uu=77

 

 Request.Url.Query

 //output:?id=1019&uu=77


 Request.Url.Fragment     

 //output:

 

 Request.Url.Segments[0]

 //output:/

 

 Request.Url.Segments[1]

 //output:Default3.aspx 


沒有留言:

張貼留言