Uri Host Name Type : Uri « Socket Network « VB.Net Tutorial






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.java2s.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
HostNameType: DNS








22.2.Uri
22.2.1.Create Uri object and get AbsolutePath and AbsoluteUri
22.2.2.Get Port and Scheme from a Uri
22.2.3.Uri.CheckHostName
22.2.4.URL properties
22.2.5.Uri Host Name Type