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

 

 

 

 

 

 

Get File and Directory Information

Download: Chilkat .NET Assemblies

Demonstrates how to get information about the files and directories in the current remote directory on an FTP server.

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

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

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

        ' 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

        ' Setting the ListPattern property causes a directory listing command to be sent to the FTP server.
        ' The Ftp2 object's properties (such as NumFilesAndDirs) and methods are automatically updated
        ' to reflect the new ListPattern.
        ftp2.ListPattern = "*"

        Dim i As Integer
        Dim n As Integer

        Dim fname As String
        Dim fileSize As Integer
        Dim lastMod As Date
        Dim isDir As Boolean

        n = ftp2.NumFilesAndDirs
        For i = 0 To n - 1
            fname = ftp2.GetFilename(i)
            fileSize = ftp2.GetSize(i)
            lastMod = ftp2.GetLastModifiedTime(i)
            isDir = ftp2.GetIsDirectory(i)

            ListBox1.Items.Add(fname + ", " + Convert.ToString(fileSize) + ", " + _
                Convert.ToString(lastMod) + ", " + Convert.ToString(isDir))

        Next

        ftp2.Disconnect()

        MessageBox.Show("Finished!")

    End Sub




 

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

Mail Component · XML Parser