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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version