C# Uri Host
Description
Uri Host
gets the host component of this instance.
Syntax
Uri.Host
has the following syntax.
public string Host { get; }
Example
The following example writes the host name of the server to the console.
/*from w w w.jav a 2 s .co m*/
using System;
public class MainClass{
public static void Main(String[] argv){
Uri baseUri = new Uri("http://www.java2s.com:8080/");
Uri myUri = new Uri(baseUri, "shownew.htm?date=today");
Console.WriteLine(myUri.Host);
}
}
The code above generates the following result.