HttpRequest.Url プロパティ

定義

現在の要求の URL に関する情報を取得します。

public:
 property Uri ^ Url { Uri ^ get(); };
public Uri Url { get; }
member this.Url : Uri
Public ReadOnly Property Url As Uri

プロパティ値

Uri

現在の要求の URL を格納している Uri オブジェクト。

次のコード例では、現在の要求のオブジェクトをオブジェクト変数に割り当て Uri 、URL オブジェクトの 2 つのプロパティの値を HTTP 出力に表示します。

Uri MyUrl = Request.Url;
 Response.Write("URL Port: " + MyUrl.Port + "<br>");
 Response.Write("URL Protocol: " + Server.HtmlEncode(MyUrl.Scheme) + "<br>");

Dim MyUrl As Uri = Request.Url
 Response.Write("URL Port: " & MyUrl.Port & "<br>")
 Response.Write("URL Protocol: " & Server.HtmlEncode(MyUrl.Scheme) & "<br>")

適用対象

こちらもご覧ください