標籤:oca 網站 raw form ble style logs 相對 伺服器
方法如下:
Request.Url.ToString()擷取完整url(協議名+網域名稱+網站名+檔案名稱+參數):https://localhost:44300/WebForm1.aspx?abc=123Request.RawUrl擷取用戶端請求的URL資訊(不包括主機和連接埠):/WebForm1.aspx?abc=123Request.Url.AbsolutePath擷取網站名+頁面名:/WebForm1.aspxRequest.Url.Host擷取主機部分:localhostRequest.Url.Query擷取參數部分:?abc=123Request.ApplicationPath擷取應用程式的虛擬應用程式根路徑:/Request.CurrentExecutionFilePath擷取當前請求的虛擬路徑:/WebForm1.aspxRequest.Path擷取當前請求的虛擬路徑:/WebForm1.aspxRequest.PathInfo擷取具有URL副檔名的資源的附加路徑資訊:Request.PhysicalPath擷取與請求的URL相對應的物理檔案系統路徑:c:\users\jim\documents\visual studio 2010\Projects\WebApplication3\WebApplication3\WebForm1.aspxRequest.Url.LocalPath擷取檔案名稱的本地作業系統表示形式:/WebForm1.aspxRequest.Url.AbsoluteUri擷取絕對URL:https://localhost:44300/WebForm1.aspx?abc=123Request.ServerVariables.Get("Local_Addr")擷取伺服器IP:::1Request.Url.Port擷取伺服器連接埠:44300Request.Url.Scheme擷取伺服器協議頭:https
asp.net擷取URL方法