Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I\'m on the following URL:
http://www.mywebsite.com:80/pages
The following (C#) code should do the trick
Uri uri = new Uri("http://www.mywebsite.com:80/pages/page1.aspx"); string requested = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port;