Dim FTPC As FTP
Dim r As Int
PATH = "/files/"
FTPC.Initialize("FTPC", "192.168.1.250", "21", "user", "password")
FTPC.PassiveMode = True
FTPC.SendCommand("CWD", PATH)
Wait For FTPC_CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String)
If Success = True Then
FTPC.List("")
Wait For FTPC_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
If Success = True Then
For r = 0 To Files.Length - 1
Log(Files(r).Name)
'<sometyhing to do...>
'<...>
'<...>
Else
Log(LastException)
End If
Else
Log(LastException)
End If