Imports System.Net
Imports System.Net.Sockets
Public Class Tester
Public Shared Sub Main
Dim URL As System.Uri
URL = New System.Uri("http://www.java2java.com/index.htm?key=value")
If URL.HostNameType = UriHostNameType.Basic Then
Console.WriteLine("HostNameType: Basic")
ElseIf URL.HostNameType = UriHostNameType.Dns Then
Console.WriteLine("HostNameType: DNS")
ElseIf URL.HostNameType = UriHostNameType.IPv4 Then
Console.WriteLine("HostNameType: IPv4")
ElseIf URL.HostNameType = UriHostNameType.IPv6 Then
Console.WriteLine("HostNameType: IPv6")
ElseIf URL.HostNameType = UriHostNameType.Unknown Then
Console.WriteLine("HostNameType: Unknown")
End If
End Sub
End Class
|