Different uses of UriBuilder

Normally we use UriBuilder to dynamically get the url of the current website. Here are some of the differences between UriBuilder.ToString() and UriBuilder.Uri.ToString()
UriBuilder.ToString() - the resulting string always contains Port, even if it is the default port for the Scheme. For example – http://dot4pro:80/articles.
UriBuilder.Uri.ToString() – the resulting string only contains the port if it is not the default port for the scheme. For example – http://dot4pro/articles.
Therefore, in most of the cases UriBuilder.Uri.ToString() should be used to omit redundant port specification.

,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share to Facebook Share to Twitter Stumble It Share on Tumblr Digg More...