Displaying URL information: Host (VB.net)
<%@ Page Language="vb" %>
<html>
<head>
<title>Displaying URL information in ASP.NET</title>
</head>
<body>
<p>
<%
Dim myUri As Uri
myUri = Request.Url
Response.Write("Current request URL info ?<br><br>")
Response.Write("Protocol: " & myUri.Scheme & "<br>")
Response.Write("Port: " & myUri.Port & "<br>")
Response.Write("Host Name: " & myUri.Host & "<br>")
myUri = Request.UrlReferrer
If Not (myUri Is Nothing) Then
Response.Write("Referral URL info ?<br><br>")
Response.Write("Protocol: " & myUri.Scheme & "<br>")
Response.Write("Port: " & myUri.Port & "<br>")
Response.Write("Host Name: " & myUri.Host & "<br>")
Response.Write("App Path: " & myUri.AbsolutePath & "<br>")
Else
Response.Write("No referral URL info available.")
End If
%>
</p>
</body>
</html>
Related examples in the same category