Chilkat .NET Ftp Class Reference (VB.NET)

Chilkat.Ftp

Free and Unsupported File Transfer Protocol (FTP) Component.

Reference Index
Chilkat Home
Example Programs

Properties

Hostname
IsConnected
LastErrorHtml
LastErrorText
LastErrorXml
ListPattern
NumFilesAndDirs
Passive
Password
Port
Proxy
UseIEProxy
Username
Version

Methods

ChangeRemoteDir
Connect
CreateRemoteDir
DeleteMatching
DeleteRemoteFile
Disconnect
GetCreateTime
GetCurrentDirListing
GetCurrentRemoteDir
GetFile
GetFilename
GetIsDirectory
GetLastAccessTime
GetLastModifiedTime
GetRemoteFileBinaryData
GetRemoteFileTextData
GetSize
MGetFiles
MPutFiles
PutFile
PutFileFromBinaryData
PutFileFromTextData
RemoveRemoteDir
RenameRemoteFile
SaveLastError

Properties

Hostname As String

The FTP server hostname.

IsConnected As Boolean (ReadOnly)

Returns true if currently connected and logged into an FTP server, otherwise returns false.

LastErrorHtml As String (ReadOnly)

Error information in HTML format for the last method called.

LastErrorText As String (ReadOnly)

Error information in plain-text format for the last method called.

LastErrorXml As String (ReadOnly)

Error information in XML format for the last method called.

ListPattern As String

A wildcard pattern, defaulting to "*" that determines the files and directories included in the following properties and methods: NumFilesAndDirs, GetCreateTime, GetFilename, GetIsDirectory, GetLastAccessTime, GetModifiedTime, GetSize.

NumFilesAndDirs As Integer (ReadOnly)

The number of files and sub-directories in the current remote directory that match the ListPattern. (The ListPattern defaults to "*", so unless changed, this is the total number of files and sub-directories.)

Passive As Boolean

Set to true for FTP to operate in passive mode, otherwise set to false for non-passive (the default).

Password As String

Password for logging into the FTP server.

Port As Integer

Port number. Automatically defaults to the default port for the FTP service.

Proxy As String

The name of a proxy server when accessing FTP via a proxy .

UseIEProxy As Boolean

Set this property to true to use the FTP proxy configured for Internet Explorer.

Username As String

Username for logging into the FTP server. Defaults to "anonymous".

Version As String (ReadOnly)

Version of the component, such as "1.0.0"

Methods

Function ChangeRemoteDir(ByVal relativeDirPath As String) As Boolean

Changes the current remote directory.

Function Connect() As Boolean

Connects and logs in to the FTP server using the username/password provided in the component properties.

Function CreateRemoteDir(ByVal dir As String) As Boolean

Creates a directory on the FTP server. Returns true for success, false for failure. If the directory already exists, a new one is not created and false is returned.

Function DeleteMatching(ByVal remotePattern As String) As Integer

Deletes all the files in the current remote FTP directory matching the pattern. Returns the number of files deleted, or -1 for failure. The pattern is a string such as "*.txt", where any number of "*" wildcard characters can be used. "*" matches 0 or more of any character, and "?" matches exactly 1 of any character.

Function DeleteRemoteFile(ByVal filename As String) As Boolean

Deletes a file on the FTP server.

Function Disconnect() As Boolean

Disconnects from the FTP server, ending the current session.

Function GetCreateTime(ByVal index As Integer) As Date

Returns the create time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)

Function GetCurrentDirListing(ByVal pattern As String) As String

Returns (in XML format) the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.

Function GetCurrentRemoteDir() As String

Returns the current remote directory.

Function GetFile(ByVal remoteFilename As String, ByVal localFilename As String) As Boolean

Copies a file from the FTP server to the local filesystem. Returns true for success and false for failure.[

Function GetFilename(ByVal index As Integer) As String

Returns the filename for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)

Function GetIsDirectory(ByVal index As Integer) As Boolean

Returns1 for a sub-directory and 0 for a file, for the Nth entry in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)

Function GetLastAccessTime(ByVal index As Integer) As Date

Returns the last access time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)

Function GetLastModifiedTime(ByVal index As Integer) As Date

Returns the last modified time for the Nth file or sub-directory in the current remote directory. The first file/dir is at index 0, and the last one is at index (NumFilesAndDirs-1)

Function GetRemoteFileBinaryData(ByVal remoteFilename As String) As Byte()

Returns the contents of a remote file. A null is returned on failure.

Function GetRemoteFileTextData(ByVal remoteFilename As String) As String

Returns the contents of a remote file. A null is returned on failure.[

Function GetSize(ByVal index As Integer) As Integer

Returns the size of the Nth remote file in the current directory.

Function MGetFiles(ByVal remotePattern As String, ByVal localDir As String) As Integer

Copies all the files in the current remote FTP directory to a local directory. To copy all the files in a remote directory, set remotePattern to "*.*" The pattern can contain any number of "*" or "?" characters where "*" matches 0 or more of any character, and "?" matches any single character. The return value is the number of files transferred, and on error, a value of -1 is returned. Detailed information about the transfer can be obtained from the XML log.

Function MPutFiles(ByVal pattern As String) As Integer

Copies all the files matching pattern on the local computer to the current remote FTP directory. The pattern parameter can include directory information, such as "C:/my_dir/*.txt" or it can simply be a pattern such as "*.*" that matches the files in the application's current directory. Subdirectories are not recursed. The return value is the number of files copied, with a value of -1 returned for errors. Detailed information about the transfer can be obtained from the XML log.[

Function PutFile(ByVal localFilename As String, ByVal remoteFilename As String) As Boolean

Copies a local file to the current directory on the FTP server.[

Function PutFileFromBinaryData(ByVal remoteFilename As String, ByVal content As Byte()) As Boolean

Creates a file on the remote server containing the data passed in a byte array. Returns true for success, false for failure.

Function PutFileFromTextData(ByVal remoteFilename As String, ByVal textData As String, ByVal charset As String) As Boolean

Creates a file on the remote server containing the data passed in a string. Returns true for success, false for failure.[

Function RemoveRemoteDir(ByVal dir As String) As Boolean

Removes a directory from the FTP server.

Function RenameRemoteFile(ByVal existingFilename As String, ByVal newFilename As String) As Boolean

Renames a file on the FTP server.

Function SaveLastError(ByVal filename As String) As Boolean

Saves the last error information to an XML formatted file.

Copyright 2000-2006 Chilkat Software, Inc.