Bahasa

HttpRequest.Url Properti

Definisi

Mendapatkan informasi tentang URL permintaan saat ini.

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

Nilai Properti

Uri

Objek Uri yang berisi URL permintaan saat ini.

Contoh

Contoh kode berikut menetapkan Uri objek permintaan saat ini ke variabel objek dan menampilkan nilai dua properti objek URL ke output 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>")

Berlaku untuk

Lihat juga