VB.Net Tutorial/Socket Network/UriBuilder

Материал из VB Эксперт
Перейти к: навигация, поиск

UriBuilder

Imports System.Net
Imports System.Net.Sockets

Public Class Tester
    Public Shared Sub Main
        Dim myUriBuilder As UriBuilder
        Try
            myUriBuilder = New UriBuilder("http", "www.vbex.ru", 80, "/index.html")
        Catch ex As ArgumentException
            Console.WriteLine(ex.Message)
        End Try
        Dim myUri As Uri = myUriBuilder.Uri
        Console.WriteLine(myUri.ToString())
        Console.WriteLine(myUriBuilder.Scheme)
        Console.WriteLine(myUriBuilder.Port.ToString)
        Console.WriteLine(myUriBuilder.Host)
        Console.WriteLine(myUriBuilder.Path)

    End Sub
End Class
http://www.vbex.ru/index.html
http
80
www.vbex.ru
/index.html