VB.NET Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

FTP Upload File with Progress Monitoring

Download: Chilkat .NET Assemblies

This VB.NET example program demonstrates how to do an FTP upload with progress monitoring.

    ' When using events, the Chilkat.Ftp2 object must be a class member or global variable.
    Dim WithEvents ftp2 As New Chilkat.Ftp2

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ftp2.UnlockComponent("Anything for 30-day trial")

        ftp2.Hostname = "ftp.chilkatsoft.com"
        ftp2.Username = "******"
        ftp2.Password = "*****"

        ' EnableEvents must be set to True for events to fire.
        ftp2.EnableEvents = True

        ' Set the SendBufferSize to a smaller value than the default of 512K to get more frequent callbacks:
        ' This may slightly degrade performance.
        ftp2.SendBufferSize = 4096

        ' Connect to the FTP server and login.
        Dim success As Boolean
        success = ftp2.Connect()
        If (Not success) Then
            ftp2.SaveLastError("ftpError.txt")
            Exit Sub
        End If

        ' Navigate to the "testing" subdirectory on the ftp server.
        success = ftp2.ChangeRemoteDir("testing")
        If (Not success) Then
            ftp2.SaveLastError("ftpError.txt")
            Exit Sub
        End If

        ' Upload the file. 
        success = ftp2.PutFile("big.gif", "big.gif")
        If (Not success) Then
            ftp2.SaveLastError("ftpError.txt")
            Exit Sub
        End If

        ftp2.Disconnect()

    End Sub

    ' Update the progress bar control with the percent done.
    Private Sub ftp2_OnFtpPercentDone(ByVal sender As Object, ByVal args As Chilkat.FtpPercentDoneEventArgs) Handles ftp2.OnFtpPercentDone

        ProgressBar1.Value = args.PercentDone

    End Sub



 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser