C# Uri DnsSafeHost
Description
Uri DnsSafeHost
gets an unescaped host name that is safe
to use for DNS resolution.
Syntax
Uri.DnsSafeHost
has the following syntax.
public string DnsSafeHost { get; }
Example
The following code shows how to use Uri.DnsSafeHost.
/* ww w . j a v a 2s . c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
Uri address = new Uri("http://java2s.com/temp/example.htm");
Console.WriteLine(address.Host);
Console.WriteLine(address.DnsSafeHost);
}
}
The code above generates the following result.