HttpRequest.RawUrl 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得目前請求的原始網址。
public:
property System::String ^ RawUrl { System::String ^ get(); };
public string RawUrl { get; }
member this.RawUrl : string
Public ReadOnly Property RawUrl As String
屬性值
目前請求的原始網址。
範例
以下程式碼範例使用 HtmlEncode 了將屬性值 RawUrl HTML 編碼的方法,以及 WriteLine 將編碼值寫入檔案的方法。 此程式碼範例是本類別更大範例 HttpRequest 的一部分。
// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.PhysicalApplicationPath));
sw.WriteLine(Server.HtmlEncode(Request.PhysicalPath));
sw.WriteLine(Server.HtmlEncode(Request.RawUrl));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.PhysicalApplicationPath))
sw.WriteLine(Server.HtmlEncode(Request.PhysicalPath))
sw.WriteLine(Server.HtmlEncode(Request.RawUrl))
備註
原始網址定義為網址中緊接網域資訊的部分。 在 URL 字串 http://www.contoso.com/articles/recent.aspx中,原始網址為 /articles/recent.aspx。 原始網址中包含查詢字串(若存在)。