Displaying URL information: Port (VB.net) : URI URL « Response « ASP.Net






Displaying URL information: Port (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

1.Creating Absolute URLs for cookieless sessions (VB.net)
2.Displaying URL information: Scheme (VB.net)
3.Displaying URL information: Host (VB.net)
4.Referral URL info (VB.net)