Click or drag to resize

Ftp Class

FTP client implementation. Allows listing, moving, copying, downloading and uploading files using FTP/FTPS protocol.
Inheritance Hierarchy

Namespace:  Limilabs.FTP.Client
Assembly:  Ftp (in Ftp.dll) Version: 2.0.22214.1022
Syntax
public class Ftp : TcpTextClient

The Ftp type exposes the following members.

Constructors
  NameDescription
Public methodFtp
Initializes new instance of the Ftp class (IPv4 is used).
Public methodFtp(AddressFamily)
Initializes new instance of the Ftp class.
Top
Properties
  NameDescription
Public propertyActiveModeAddress
Gets or sets the IP address announced to the FTP server when establishing an Active mode data transfer. Don't set this unless needed. By default, the value of this property is None which means that the address of the network interface is used instead. This has no effect for passive mode transfers.
Public propertyActiveModePorts
Gets or sets the port range used in Active mode. This has no effect for passive mode transfers.
Public propertyASCIIChangeNewLines
Specifies if new lines should be changed when TransfersDataType is set to Ascii transfers. Default is false.
Public propertyConfiguration
Gets FTP protocol configuration.
Public propertyConnected
Gets a value indicating whether the underlying Socket is connected to a remote host. This property makes a nonblocking, zero-byte Send call to determine the current state of the connection.
(Inherited from TcpTextClient.)
Public propertyDontUseCompression
Forces the compression not to be used. You should set this field before connecting to the remote server. Default value is false.
Public propertyExtensions
Gets features container that can be used to check what FtpExtensions are supported by the server.
Public propertyIgnorePassiveModeAddress
Ignores address sent by the FTP server for data connections in Passive mode in response to PASV command. Default is .
Public propertyIgnorePassiveModeLocalAddress
Gets or sets the value indicating if a workaround for FTP servers that announce private range IP addresses even though a public IP was used for control connection. By default, when such address is detected, an IP address announced by the server in response to PASV command is ignored. Control's connection address is used instead. Default is .
Public propertyIsEncrypted
Gets a Boolean value that indicates whether communication to the remote server is encrypted.
(Inherited from TcpTextClient.)
Public propertyIsMutuallyAuthenticated
Gets a Boolean value that indicates whether communication to the remote server is mutually authenticated.
(Inherited from TcpTextClient.)
Public propertyIsSigned
Gets a Boolean value that indicates whether communication to the remote server is signed.
(Inherited from TcpTextClient.)
Public propertyMode
FTP data connection mode: Active (client waits for incoming data connections) or Passive (client establishes data connections). Passive is default.
Public propertyProtectionBufferSize
Gets or sets the maximum size, in bytes, of the encoded data blocks to be sent or received during file transfer.
Public propertyReceiveTimeout
Gets or sets the amount of time the underlying Socket will wait to receive data once a read operation is initiated.
(Inherited from TcpTextClient.)
Public propertySendTimeout
Gets or sets the amount of time the underlying Socket will wait for a send operation to complete successfully.
(Inherited from TcpTextClient.)
Public propertySocket
Gets the underlying Socket.
(Inherited from TcpTextClient.)
Public propertySSLConfiguration
Gets SSL configuration for this object (client certificates, enabled SSL protocols).
(Inherited from TcpTextClient.)
Public propertyStream
Gets underlying read stream for current connection.
(Inherited from TcpTextClient.)
Public propertyTransfersDataType
Gets or sets data type used for all data transfers. Default is Binary (I).
Public propertyUsesCompression
Gets a value indicating whether the compression is used for data transfers.
Top
Methods
  NameDescription
Public methodAbort
Aborts current transfers.
Public methodAppend(String, Byte)
Appends the content of the byte array to the file on the server, creating it if it doesn't exists.
Public methodAppend(String, Stream)
Appends the content of the data streamto the file on the server, creating it if it doesn't exists.
Public methodAuthSSL Obsolete.
Secures the communication with remote server using SSL (explicit SSL). Please use ServerCertificateValidate event to handle self signed certificates.
Public methodAuthTLS
Secures the communication with remote server using TLS (explicit SSL/TLS) (RFC 4217). Please use ServerCertificateValidate event to handle self signed certificates.
Public methodBeginConnect(String)
Begins an asynchronous request for a remote server connection using DefaultPort.
Public methodBeginConnect(String, AsyncCallback)
Begins an asynchronous request for a remote server connection using DefaultPort.
Public methodBeginConnect(IPEndPoint, Boolean)
Begins an asynchronous request for a remote server connection.
(Inherited from TcpTextClient.)
Public methodBeginConnect(String, Int32)
Begins an asynchronous request for a remote server connection. You can use BeginConnectSSL(String, Int32) when SSL connection is needed.
(Inherited from TcpTextClient.)
Public methodBeginConnect(String, Int32, Boolean)
Begins an asynchronous request for a remote server connection.
(Inherited from TcpTextClient.)
Public methodBeginConnect(String, Int32, Boolean, AsyncCallback)
Begins an asynchronous request for a remote server connection.
(Inherited from TcpTextClient.)
Public methodBeginConnectSSL(String)
Begins an asynchronous request for a remote server secure connection using DefaultSSLPort and SSL.
Public methodBeginConnectSSL(String, AsyncCallback)
Begins an asynchronous request for a remote server secure connection using DefaultSSLPort and SSL.
Public methodBeginConnectSSL(String, Int32)
Begins an asynchronous request for a remote server secure connection using SSL.
(Inherited from TcpTextClient.)
Public methodBeginConnectSSL(String, Int32, AsyncCallback)
Begins an asynchronous request for a remote server secure connection using SSL.
(Inherited from TcpTextClient.)
Public methodChangeFolder
Changes the current working folder on the server.
Public methodChangeFolderUp
Changes the current working folder on the server one level up.
Public methodClose
Sends QUIT command. Releases all resources acquired by this object.
Public methodClose(Boolean)
Sends QUIT command. Releases all resources acquired by this object.
Public methodConnect(String)
Connects to FTP server on port 21. Use ConnectSSL(String) when SSL connection is needed.
Public methodConnect(IPEndPoint, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnect(String, Int32)
Connects to server. Use ConnectSSL(String, Int32) when SSL connection is needed.
(Inherited from TcpTextClient.)
Public methodConnect(IPAddress, Int32, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnect(String, Int32, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnectSSL(String)
Connects to FTP server using SSL on port 990. Please use ServerCertificateValidate for self signed certificates.
Public methodConnectSSL(String, Int32)
Connects to server using SSL.
(Inherited from TcpTextClient.)
Public methodCreateAllFolders
Creates all the directories and subdirectories in a specified by the remotePath. Some servers implement this feature by default, in such case you can use CreateFolder(String) method.
Public methodCreateFolder
Creates a folder on the server.
Public methodDeleteFile
Deletes the file on the server.
Public methodDeleteFiles(ListRemoteSearchItem)
Deletes specified files from the server.
Public methodDeleteFiles(RemoteSearchOptions)
Deletes files from the current server folder, that match specified pattern.
Public methodDeleteFiles(String, RemoteSearchOptions)
Deletes files from the server, that match specified pattern.
Public methodDeleteFolder
Deletes an empty remote folder with the specified pathname.
Public methodDeleteFolderRecursively
Deletes remote folder recursively with the specified pathname.
Public methodDispose
Releases all resources acquired by this object. Closes connection, without issuing any quit commands.
(Inherited from TcpTextClient.)
Protected methodDispose(Boolean)
Releases all resources acquired by this object. Closes connection, without issuing any quit commands.
(Inherited from TcpTextClient.)
Public methodDownload(String)
Downloads the remote file.
Public methodDownload(String, Int64)
Downloads the remote file starting from the specified position. You can check the value of SupportsRestStream of Extensions property to check if this method is supported by the remote server.
Public methodDownload(String, Stream)
Downloads the remote file to the data stream.
Public methodDownload(String, String)
Downloads the remote file to the local file.
Public methodDownload(String, Int64, Stream)
Downloads the remote file to the data stream starting from the specified position. You can check the value of SupportsRestStream of Extensions property to check if this method is supported by the remote server.
Public methodDownloadFiles(String)
Downloads remote files from the current server folder to the local location.
Public methodDownloadFiles(String, RemoteSearchOptions)
Downloads remote files from the current server folder to local location.
Public methodDownloadFiles(String, ListRemoteSearchItem)
Downloads remote files to the local location.
Public methodDownloadFiles(String, String)
Downloads remote files to local location.
Public methodDownloadFiles(String, String, RemoteSearchOptions)
Downloads remote files to the local location.
Public methodEndConnect
Ends a pending asynchronous connection request.
(Inherited from TcpTextClient.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFeat
Returns the list of additional features supported by the remote server (FEAT command).
Public methodFileExists
Detects whether the specified file exists on the server.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFolderExists
Detects whether the specified folder exists on the server.
Public methodGetCurrentFolder
Gets the absolute path of the current working folder on the remote server.
Public methodGetFileHash(String, FtpHashType)
Returns the checksum of the specified remote file. You can use FileHash class to compute or validate local file checksum.
Public methodGetFileHash(String, FtpHashType, Int64, Int64)
Returns the checksum of the specified remote file. You can use FileHash class to compute or validate local file checksum.
Public methodGetFileModificationTime
Returns the modification date and time of the specified remote file. This method uses MDTM command (RFC 3659), that may be NOT supported by the server. You can check the value of SupportsMDTM of Extensions property to check if this method is supported by the remote server.
Public methodGetFileSize
Returns the size of the specified remote file. You can check the value of SupportsSize of Extensions property to check if this method is supported by the remote server.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetList
Returns parsed list of files and folders in the current server folder.
Public methodGetList(String)
Returns parsed list of files and folders in the specific server folder.
Protected methodGetServerGreeting
Get server's greeting.
(Overrides TcpTextClientGetServerGreeting.)
Public methodGetSupportedHashTypes Obsolete.
Returns checksum types supported by the server.
Public methodGetSystem
Returns the name of the remote OS.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHash
Returns the checksum of the specified remote file. You can use FileHash class to compute or validate local file checksum.
Public methodKeepAliveDuringTransfer
Sets the interval, at which a NOOP command is sent on the control conenction during a file transfer.
Public methodKeepAliveTcp
Sets TCP protocol keep alive (SO_KEEPALIVE) option on.
(Inherited from TcpTextClient.)
Public methodList
Returns parsed list of files and folders in the current server folder. This method uses LIST command. There is no standard that describes LIST command response, GetList is a better choice in most cases.
Public methodList(String)
Returns parsed list of files and folders in the specified server folder. This method uses LIST command (RFC 959). There is no standard that describes LIST command response, GetList(String) is a better choice in most cases.
Public methodLogin(String)
Logs user in using specified user and empty password.
Public methodLogin(String, String)
Logs user in.
Public methodLogin(String, String, String)
Logs user in.
Public methodLoginAnonymous
Logs user in using "anonymous" as user and "anonymous@example.com" as password.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMLSD
Returns parsed list of files and folders in the current server folder. This method uses MLSD command (RFC 3659), that may be NOT supported by the server.
Public methodMLSD(String)
Returns parsed list of files and folders in the specified folder or file information in case of a file. This method uses MLSD command (RFC 3659), that may be NOT supported by the server.
Public methodMLST
Returns information about current server folder. This method uses MLST command (RFC 3659), that may be NOT supported by the server.
Public methodMLST(String)
Returns information about current server folder. This method uses MLST command (RFC 3659), that may be NOT supported by the server.
Public methodNLST
Returns a list of file and folder names in the current server folder. This method uses NLST command (RFC 3659), that may be NOT supported by the server.
Public methodNLST(String)
Returns a list of file and folder names in the current server folder. This method uses NLST command (RFC 3659), that may be NOT supported by the server.
Public methodNoop
Sends NO OPeration command to the server.
Public methodRename
Renames a file or folder on the server.
Public methodSearch
Returns all files and folders on the server.
Public methodSearch(RemoteSearchOptions)
Searches files and folders on the server that match specified pattern.
Public methodSearch(String, RemoteSearchOptions)
Searches files and folders on the server that match specified pattern.
Public methodSend
Sends the text command to server. Adds "\r\n" to the command.
(Inherited from TcpTextClient.)
Public methodSendAsync
Sends the text command to server. Adds "\r\n" to the command.
(Inherited from TcpTextClient.)
Public methodSendCommand(String)
Executes command on the FTP server.
Public methodSendCommand(String, Boolean)
Executes command on the FTP server.
Public methodSendCommand(String, Object)
Executes command on the FTP server.
Public methodSendCommand(String, Boolean, Object)
Executes command on the FTP server.
Public methodSendCommandAsync(String)
Executes command on the FTP server.
Public methodSendCommandAsync(String, Boolean)
Executes command on the FTP server.
Public methodSendCommandAsync(String, Object)
Executes command on the FTP server.
Public methodSendCommandAsync(String, Boolean, Object)
Executes command on the FTP server.
Public methodSendDownloadCommand
Executes command on the FTP server and expects response using data channel.
Public methodSetFileModificationTime
Sets the modification date and time of the specified remote file. This method uses MFTM (draft-somers-ftp-mfxx-04) or MDTM (RFC 3659) commands, that may be NOT supported by the server.
Public methodSetTransferMode
Forces transfer mode change.
Public methodSite
Sends SITE command to the server.
Public methodSiteChangeMode(String)
Executes SITE CHMOD command: removes all privileges for all.
Public methodSiteChangeMode(String, UnixPermissionSet)
Executes SITE CHMOD command - changes the permissions of the file to specified value
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpload(String, Byte)
Uploads the content of the byte array to the file on the server.
Public methodUpload(String, Stream)
Uploads the content of the data stream to the file on the server.
Public methodUpload(String, String)
Uploads the content of the local file to the file on the server, overriding it if it already exists.
Public methodUpload(String, Int64, Byte)
Uploads the content of the byte array to the file on the server starting from the specified remote position. You can check the value of SupportsRestStream of Extensions property to check if this method is supported by the remote server.
Public methodUpload(String, Int64, Stream)
Uploads the content of the data stream to the file on the server from the specified remote position. You can check the value of SupportsRestStream of Extensions property to check if this method is supported by the remote server.
Public methodUploadAsync
Uploads the content of the data stream to the file on the server from the specified remote position. You can check the value of SupportsRestStream of Extensions property to check if this method is supported by the remote server.
Public methodUploadFiles(String)
Uploads local files to the current remote server location.
Public methodUploadFiles(String, LocalSearchOptions)
Uploads local files to the current remote server location.
Public methodUploadFiles(String, String)
Uploads local files to remote location.
Public methodUploadFiles(String, String, LocalSearchOptions)
Uploads local files to remote location.
Public methodUploadUnique(Byte)
Uploads the content of the local file to the file with unique name on the server.
Public methodUploadUnique(Stream)
Uploads the content of the stream to the file with unique name on the server.
Top
Events
  NameDescription
Public eventBatchProgress
Reports progress of the current batch upload or download.
Public eventProgress
Reports progress of the current upload or download. This event may be raised from a different thread.
Public eventServerCertificateValidate
Event which is called for custom server certificate validation.
(Inherited from TcpTextClient.)
Top
Fields
  NameDescription
Public fieldStatic memberDefaultPort
Gets the number of default port used for FTP's control connection.
Public fieldStatic memberDefaultSSLPort
Gets the number of default port used for FTP's control connection using SSL.
Top
Remarks
See Also