Assembly: System (in system.dll)
Property ValueA String that contains the unescaped host part of the URI that is suitable for DNS resolution; or the original unescaped host string, if it is already suitable for resolution.
This instance represents a relative URI, and this property is valid only for absolute URIs.
For IPv6 addresses, the brackets () are removed and the ScopeId property is set, if one was specified when this instance was constructed.
The following example creates a Uri instance from a string. It illustrates the difference between the value returned from Host, which returns the host name or address specified in the URI, and the value returned from DnsSafeHost, which returns an address that is safe to use in DNS resolution.
// Create new Uri using a string address. Uri address = new Uri("http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm"); // Make the address DNS safe. // The following outputs "[fe80::200:39ff:fe36:1a2d]". Console.WriteLine(address.Host); // The following outputs "fe80::200:39ff:fe36:1a2d%4". Console.WriteLine(address.DnsSafeHost);
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.