Returns a value that describes the format of a host name string.
- name
- A string containing the host name to validate.
A UriHostNameType that indicates the type of the host name. If the type of the host name cannot be determined, or the host name is null or a zero-length string, returns UriHostNameType.Unknown .
Documentation for this section has not yet been entered.
The following example demonstrates using the Uri.CheckHostName(string) method.
C# Example
using System; public class UriTest { public static void Main() { Console.WriteLine(Uri.CheckHostName("www.contoso.com")); } }The output is
Dns
Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0