HttpRequest.RawUrl HttpRequest.RawUrl HttpRequest.RawUrl HttpRequest.RawUrl Property

定義

取得目前要求的原始 URL。Gets the raw URL of the current request.

public:
 property System::String ^ RawUrl { System::String ^ get(); };
public string RawUrl { get; }
member this.RawUrl : string
Public ReadOnly Property RawUrl As String

屬性值

目前要求的原始 URL。The raw URL of the current request.

範例

下列程式碼範例會使用HtmlEncode方法,以 HTML 編碼的值RawUrl屬性和WriteLine方法來寫入檔案的編碼的值。The following code example uses the HtmlEncode method to HTML-encode the value of the RawUrl property and the WriteLine method to write the encoded value to the file. 此程式碼範例是針對提供之較大範例的一部分HttpRequest類別。This code example is part of a larger example provided for the HttpRequest class.

// 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 被定義為下列網域資訊的 URL 的一部分。The raw URL is defined as the part of the URL following the domain information. URL 字串中http://www.contoso.com/articles/recent.aspx,原始的 URL 是 /articles/recent.aspx。In the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx. 如果有的話,原始的 URL 會包含查詢字串。The raw URL includes the query string, if present.

適用於