Imports System.Text
Imports Limilabs.FTP.Client

Module Module1

    Sub Main()
        Using client As New Ftp()
            client.Connect("ftp.example.org")
            client.Login("username", "password")

            ' Upload the 'test.zip' file to the current folder on the server 
            client.Upload("test.zip", "c:\test.zip")

            ' Upload the 'index.html' file to the specified folder on the server 
            client.Upload("/wwwroot/index.html", "c:\index.html")

            ' Download the 'test.zip' file from the current folder on the server 
            client.Download("test.zip", "c:\test2.zip")

            ' Download the 'index.html' file from the specified folder on the server 
            client.Download("/wwwroot/index.html", "c:\index.html")

            ' upload in memory text 
            Const message As String = "Hello from Ftp.dll"
            Dim data As Byte() = Encoding.[Default].GetBytes(message)
            client.Upload("message.txt", data)

            client.Close()
        End Using
    End Sub

End Module
