How do you extract the Web Site name from a URL or a Link. I have found examples for other languages but not c#. Also the URL / Link will not be the current page that i am on.
e.g. http://www.test.com/SomeOther/Test/Test.php?args=1
From that i need to extract just http://www.test.com , keep in mind that it wont always be .com and it can be any domain
How about:
For example:
Check out the docs for the constructor taking a string and the
Hostproperty.Note that if it’s not a “trusted” data source (i.e. it could be invalid) you might want to use Uri.TryCreate: