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

 

 

 

 

 

 

Implicit Secure FTP SSL on Port 990

Download: Chilkat .NET Assemblies

VB.NET sample program demonstrating FTP over SSL on port 990.

    ' This example demonstrates how to do secure FTP uploads and downloads
    ' using implicit SSL on FTP port 990.  This is a less common way of doing secure FTP.
    ' If the FTP client is behind a network address translating router, such as a typical
    ' DSL/Cable router, this will not work when the transfer mode is Active, as opposed to Passive.
    ' The reason is that the router cannot translate the IP address issued in the PORT command
    ' when setting up the data channel.  To do secure FTP behind a router, use "AUTH TLS" 
    ' instead.  (refer to http://www.example-code.com/vbdotnet/ftps_auth_tls.asp )

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Dim ftp As New Chilkat.Ftp2
        Dim success As Boolean

        success = ftp.UnlockComponent("Anything for 30-day trial")
        If (Not success) Then
            MessageBox.Show(ftp.LastErrorText)
            Exit Sub
        End If

        ' Set the AuthTls property = false.
        ftp.AuthTls = False

        ' Set Ssl = True and the port must be 990:
        ftp.Ssl = True
        ftp.Port = 990

        ' Set the FTP hostname, login, and password.
        ftp.Hostname = "ftp.myftpserver.com"
        ftp.Username = "web0041"
        ftp.Password = "****"

        ' Session logging is not required, but I'm turning it on here to see
        ' what transpires during the FTP session.  The session log provides the
        ' unencrypted FTP requests and responses.
        ftp.KeepSessionLog = True

        ' Connect and login to the FTP server.  
        success = ftp.Connect()
        If (Not success) Then
            MessageBox.Show(ftp.LastErrorText)
            Exit Sub
        End If

        ' Upload a file.
        Dim localFilename As String
        Dim remoteFilename As String
        localFilename = "hamlet.xml"
        remoteFilename = "hamlet.xml"

        success = ftp.PutFile(localFilename, remoteFilename)
        If (Not success) Then
            MessageBox.Show(ftp.LastErrorText)
            Exit Sub
        End If

        ' You may examine the LastErrorText even when successful
        ' to review the details of the file transfer.  You can verify
        ' that the file was transferred over a secure channel:
        MessageBox.Show(ftp.LastErrorText)

        ' Download a file.
        localFilename = "hamletDownloaded.xml"

        success = ftp.GetFile(remoteFilename, localFilename)
        If (Not success) Then
            MessageBox.Show(ftp.LastErrorText)
            Exit Sub
        End If

        ' Disconnect
        ftp.Disconnect()

        ' Display the session log
        TextBox1.Text = ftp.SessionLog

    End Sub


 

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

Mail Component · XML Parser