The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Uri.Host Property

Gets the Domain Name System (DNS) host name, or IP address of the server specified in the URI.

[Visual Basic]
Public ReadOnly Property Host As String
public string Host {get;}
public: __property String* get_Host();
public function get Host() : String;

Property Value

A string containing the DNS host name or IP address of the server.


The Host property gets the fully qualified DNS host name or IP address of the server specified in the URI.


The following example writes the host name ( of the server to the console.

[Visual Basic] 
Dim baseUri As New Uri("")
Dim myUri As New Uri(baseUri,"shownew.htm?date=today")

Uri baseUri = new Uri("");
Uri myUri = new Uri(baseUri, "shownew.htm?date=today");

Uri* baseUri = new Uri(S"");
Uri* myUri = new Uri(baseUri, S"shownew.htm?date=today");

var baseUri : Uri = new Uri("");
var myUri : Uri = new Uri(baseUri, "shownew.htm?date=today");


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft