Mono Class Library: System.Uri Overview | MembersSystem.Uri.Host Property |
Gets the host component of the URI used to construct the current instance. [Edit]
|
A string containing the DNS host name or IP address of the host server. If the host information was not specified to the constructor, the value of this property is string.Empty . [Edit]
This property is read-only.
If the host information is an IP6 address, the information is enclosed in square brackets ("[" and "]").
[Edit]
The following example demonstrates using the Uri.Host property.
C# Example using System; public class UriTest { public static void Main() { Uri baseUri = new Uri("http://www.contoso.com:8080/"); Uri myUri = new Uri(baseUri, "shownew.htm?date=today"); Console.WriteLine(myUri.Host); } }The output is
www.contoso.com
Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0