HttpRequest.Url Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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
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>")