Visual Basic FTP Example

' download file from FTP server

Function Download(ByVal Host As String, ByVal User As String, ByVal Pass As String, ByVal Folder As String, ByVal FileName As String) As Integer
Dim Code As Integer
' connect to server (Host)
Code = fceConnect(0, Host, User, Pass)
' error ? (negative return codes are errors)
If Code < 0 Then
  return Code
End If
' change to proper directory
Code = fceSetServerDir(0, Folder)
If Code < 0 Then
  return Code
End If
' set binary xfer mode
' download the file
Code = fceGetFile(0, FileName)
Download = Code
End Function

MSC Logo

MARSHALLSOFT is a trademark of MarshallSoft Computing, Inc.