C# Class _3PA.Lib.Ftp.FtpsClient

Class used to connect to an FTP/FTPS server. The main goal of this class is to provide a complete and easy to use FTP client connection, implementing SSL/TLS extension and providing tested compatibility to the main FTP server products. Implemented RFCs: 959, 2228, 2389, 2428, 2640, 3659, 4217. Not all commands described in the above RFCs are implemented at the current stage.
Requirements: MS Framework 2.0 and above or Mono 2.0 and above.
Inheritance: IDisposable
Show file Open project: jcaillon/3P Class Usage Examples

Private Properties

Property Type Description
AppeCmd void
AuthCmd void
CallTransferCallback void
CccCmd void
CdupCmd void
CheckCommandInjection void
CheckConnection void
CheckFeature bool
CheckSslAlgorithmsStrength void
CheckSymLinks void
ClntCmd void
CloseCtrlConnection void
CloseDataConnection void
CombineRemotePath string
CreateSSlStream System.Net.Security.SslStream
CwdCmd void
DeleCmd void
EndStreamCommand FtpStream
EnsureDir void
EpsvCmd void
FeatCmd IList
GetCtrlConnAddressFamily AddressFamily
GetDataStream Stream
GetDataString string
GetFeaturesFromServer void
GetFiles void
GetRegexPattern string
GetReply FtpReply
GetUniquePath string
HandleCmd FtpReply
HandleCmd FtpReply
KeepAliveThreadFunc void
LangCmd void
ListCmd void
MdtmCmd System.DateTime
MkdCmd void
NlstCmd void
NoopCmd void
OptsCmd void
ParseEpsvReply System.Net.IPEndPoint
ParseFtpDateTime System.DateTime
ParsePasvReply System.Net.IPEndPoint
ParsePwdReply string
ParseStouReply string
PassCmd string
PasvCmd void
PbszCmd void
PortCmd void
ProtCmd void
PwdCmd string
QuitCmd void
RetrCmd void
RmdCmd void
RnfrCmd void
RntoCmd void
SSlCtrlChannelCheckRevertToClearText void
SendFile ulong
SetDataClientTimeout void
SetSslInfo void
SetupActiveDataConnectionStep1 int
SetupActiveDataConnectionStep2 void
SetupCtrlConnection void
SetupCtrlStreamReaderAndWriter void
SetupDataConnection void
SetupPassiveDataConnection void
SizeCmd ulong
SslControlChannelCheckExplicitEncryptionRequest void
SslDataChannelCheckExplicitEncryptionRequest void
SslDataChannelImplicitEncryptionRequest void
StopActiveDataConnListener void
StorCmd void
StouCmd void
SwitchCtrlToClearMode void
SwitchCtrlToSslMode void
SystCmd string
TypeCmd void
UserCmd bool
ValidateServerCertificate bool

Public Methods

Method Description
AppendFile ( string remoteFileName ) : FtpStream
AppendFile ( string localFileName, string remoteFileName ) : ulong

AppendFile overload to easily transfer a file from local to remote

AppendFile ( string localFileName, string remoteFileName, FileTransferCallback transferCallback ) : ulong

AppendFile overload to easily transfer a file from local to remote

ChangeToUpperDir ( ) : void

Changes the remote directory to the parent directory.

Close ( ) : void

Closes the current connection, freeing resources.

Connect ( string hostname ) : string

Anonymous authentication

Connect ( string hostname, EsslSupportMode sslSupportMode ) : string

Anonymous authentication

Connect ( string hostname, NetworkCredential credential ) : string
Connect ( string hostname, NetworkCredential credential, EsslSupportMode sslSupportMode ) : string
Connect ( string hostname, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate ) : string
Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout ) : string

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.

Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout, bool useCtrlEndPointAddressForData ) : string

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.

Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout, bool useCtrlEndPointAddressForData, EDataConnectionMode dataConnectionMode ) : string

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.

Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, int timeout ) : string
DeleteFile ( string remoteFileName ) : void

Deletes the given remote file.

Dispose ( ) : void
GetCurrentDirectory ( ) : string
GetDirectoryList ( ) : IList
GetDirectoryList ( string remoteDirName ) : IList

Returns a list of the contents form the given directory. A parsing is performed on the data returned fronm the LIST command.

Please use GetShortDirectoryList(string) or GetDirectoryListUnparsed(string) in case of parsing errors, as the contents returned from FTP servers may differ from the common DOS and UNIX formats adopted here.

GetDirectoryListUnparsed ( ) : string
GetDirectoryListUnparsed ( string remoteDirName ) : string

returns the given directory list data as returned from the server, without parsing its contents.

GetFeatures ( ) : IList

Features returned from the FEAT command

GetFile ( string remoteFileName ) : FtpStream

Retrieves the given file from the server. A FtpStream is returned, to be read until the end of file. See the GetFile(string, string) overload to easily save the stream to a local file.

GetFile ( string remoteFileName, string localFileName ) : ulong

GetFile overload to easily transfer a file from remote to local

GetFile ( string remoteFileName, string localFileName, FileTransferCallback transferCallback ) : ulong

GetFile overload to easily transfer a file from remote to local

GetFileModificationTime ( string remoteFileName ) : DateTime?

Returns the modification time of the given remote file or null if the MDTM feature is not supported by the server.

GetFileTransferSize ( string remoteFileName ) : ulong?

Remote transfer file size returned by the SIZE command.

GetFiles ( string localDirectoryName ) : void

Transfers all files from the current remote directory without recursion

GetFiles ( string localDirectoryName, bool recursive ) : void

Transfers all files from the current remote directory. Optionally recursive

GetFiles ( string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive ) : void

Transfers all files, matching the given pattern, from the current remote directory. Optionally recursive

GetFiles ( string remoteDirectoryName, string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive, FileTransferCallback transferCallback ) : void

Transfers all files, matching the given pattern, from the given remote directory. Optionally recursive

GetShortDirectoryList ( ) : IList
GetShortDirectoryList ( string remoteDirName ) : IList

Returns an array of file names and directories contained in the given directory. Please use GetShortDirectoryList(string) or GetDirectoryListUnparsed(string) for more detailed directory information.

GetSystem ( ) : string

Returns some remote system information, as returned from the SYST command.

MakeDir ( string remoteDirName, bool recursive = false ) : void

Creates the given remote directory.

PopCurrentDirectory ( ) : string

Restores the current directory. For details please see PushCurrentDirectory. Throws an exception if the stack is empty.

PushCurrentDirectory ( ) : string

Pushes the current remote directory on a stack, in order to easily restore it later calling PopCurrentDirectory.

PutFile ( string remoteFileName ) : FtpStream

Stores a remote file, returning a FtpStream to be used for writing the file contents. Call FtpStream.Close on the stream once done. See the PutFile(string, string) overload to easily transfer the contents of a local file.

PutFile ( string localFileName, string remoteFileName ) : ulong

PutFile overload to easily transfer a file from local to remote

PutFile ( string localFileName, string remoteFileName, FileTransferCallback transferCallback ) : ulong

PutFile overload to easily transfer a file from local to remote

PutFiles ( string localDirectoryName ) : void

Transfers all files to the current remote directory without recursion

PutFiles ( string localDirectoryName, bool recursive ) : void

Transfers all files to the current remote directory. Optionally recursive

PutFiles ( string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive ) : void

Transfers all files, matching the given pattern, to the current remote directory. Optionally recursive

PutFiles ( string localDirectoryName, string remoteDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive, FileTransferCallback transferCallback ) : void

PutUniqueFile ( string &remoteFileName ) : FtpStream
PutUniqueFile ( string localFileName, string &remoteFileName ) : ulong

PutUniqueFile overload to easily transfer a file from local to remote

PutUniqueFile ( string localFileName, string &remoteFileName, FileTransferCallback transferCallback ) : ulong

PutUniqueFile overload to easily transfer a file from local to remote.

RemoveDir ( string remoteDirName ) : void

Removes the given remote directory.

RenameFile ( string remoteFileNameFrom, string remoteFileNameTo ) : void

Renames the given remote file.

SendCustomCommand ( string command ) : FtpReply

Sends the given FTP command text to the server.

In case of return codes >= 400 an exception is thrown.

SetCurrentDirectory ( string remoteDirName ) : void

Changes the remote current directory.

SetLanguage ( string ietfLanguageTag ) : void

Set the language used by the server during the current connection. Please check the features returned by GetFeatues for a list of available languages supported by the server.

SetTextEncoding ( ETextEncoding textEncoding ) : void

Set the given text encoding.

SetTransferMode ( ETransferMode transferMode ) : void

Set the representation type according to the given parameter

StartKeepAlive ( ) : void

Issues NOOP commands periodically in a separated thread

StopKeepAlive ( ) : void

Stops the keep alive thread

Private Methods

Method Description
AppeCmd ( string fileName ) : void
AuthCmd ( EAuthMechanism authMech ) : void
CallTransferCallback ( FileTransferCallback transferCallback, ETransferActions transferAction, string localObjectName, string remoteObjectName, ulong fileTransmittedBytes, ulong fileTransferSize ) : void
CccCmd ( ) : void
CdupCmd ( ) : void
CheckCommandInjection ( string command ) : void

Basic injection check

CheckConnection ( ) : void
CheckFeature ( string feature ) : bool
CheckSslAlgorithmsStrength ( SslStream sslStream ) : void
CheckSymLinks ( string remoteDirectoryName, IList dirList ) : void

Workaround needed because it is not possible to determine if a symlink is a directory or a file based on the UNIX style directory listing.

ClntCmd ( string name ) : void
CloseCtrlConnection ( ) : void
CloseDataConnection ( ) : void
CombineRemotePath ( string path1, string path2 ) : string

Works like Path.Combine(...), but without replacing the "/" separator with Path.DirectorySeparatorChar

CreateSSlStream ( Stream s, bool leaveInnerStreamOpen ) : SslStream
CwdCmd ( string dirName ) : void
DeleCmd ( string fileName ) : void
EndStreamCommand ( FtpStream allowedOp ) : FtpStream
EnsureDir ( string remoteDirectoryName, FileTransferCallback transferCallback ) : void

Check if the given directory exists and create it if it doesn't.

EpsvCmd ( ) : void
FeatCmd ( ) : IList
GetCtrlConnAddressFamily ( ) : AddressFamily
GetDataStream ( ) : Stream
GetDataString ( ) : string
GetFeaturesFromServer ( ) : void
GetFiles ( string remoteDirectoryName, string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive, FileTransferCallback transferCallback, IList paths ) : void
GetRegexPattern ( string filePattern, EPatternStyle patternStyle ) : string
GetReply ( ) : FtpReply
GetUniquePath ( IList paths, string localFilePath ) : string
HandleCmd ( string command ) : FtpReply
HandleCmd ( string command, bool waitForAnswer ) : FtpReply
KeepAliveThreadFunc ( ) : void
LangCmd ( string ietfLanguageTag ) : void

ListCmd ( string dirName ) : void
MdtmCmd ( string fileName ) : System.DateTime
MkdCmd ( string dirName ) : void
NlstCmd ( string dirName ) : void
NoopCmd ( ) : void
OptsCmd ( string command ) : void
ParseEpsvReply ( FtpReply reply ) : IPEndPoint
ParseFtpDateTime ( string message ) : System.DateTime
ParsePasvReply ( FtpReply reply ) : IPEndPoint
ParsePwdReply ( FtpReply reply ) : string
ParseStouReply ( FtpReply reply ) : string
PassCmd ( string password ) : string

PasvCmd ( ) : void
PbszCmd ( uint maxSize ) : void
PortCmd ( ) : void
ProtCmd ( EProtCode protCode ) : void
PwdCmd ( ) : string
QuitCmd ( bool waitForAnswer ) : void
RetrCmd ( string fileName ) : void
RmdCmd ( string dirName ) : void
RnfrCmd ( string fileOldName ) : void
RntoCmd ( string fileNewName ) : void
SSlCtrlChannelCheckRevertToClearText ( ) : void
SendFile ( string localFileName, string remoteFileName, Stream s, FileTransferCallback transferCallback ) : ulong
SetDataClientTimeout ( ) : void
SetSslInfo ( SslStream sslStream ) : void

Copies the protocol information form the given stream.

SetupActiveDataConnectionStep1 ( ) : int
SetupActiveDataConnectionStep2 ( ) : void
SetupCtrlConnection ( string hostname, int port, Encoding textEncoding ) : void
SetupCtrlStreamReaderAndWriter ( Stream s ) : void
SetupDataConnection ( ) : void
SetupPassiveDataConnection ( IPEndPoint dataEndPoint ) : void
SizeCmd ( string fileName ) : ulong
SslControlChannelCheckExplicitEncryptionRequest ( EsslSupportMode sslSupportMode ) : void
SslDataChannelCheckExplicitEncryptionRequest ( ) : void
SslDataChannelImplicitEncryptionRequest ( ) : void
StopActiveDataConnListener ( ) : void
StorCmd ( string fileName ) : void
StouCmd ( string &fileName ) : void
SwitchCtrlToClearMode ( ) : void
SwitchCtrlToSslMode ( ) : void
SystCmd ( ) : string
TypeCmd ( ERepType repType, string param2 ) : void
UserCmd ( string userName ) : bool

ValidateServerCertificate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool

Method Details

AppendFile() public method

public AppendFile ( string remoteFileName ) : FtpStream
remoteFileName string
return FtpStream

AppendFile() public method

AppendFile overload to easily transfer a file from local to remote
public AppendFile ( string localFileName, string remoteFileName ) : ulong
localFileName string
remoteFileName string
return ulong

AppendFile() public method

AppendFile overload to easily transfer a file from local to remote
public AppendFile ( string localFileName, string remoteFileName, FileTransferCallback transferCallback ) : ulong
localFileName string
remoteFileName string
transferCallback FileTransferCallback
return ulong

ChangeToUpperDir() public method

Changes the remote directory to the parent directory.
public ChangeToUpperDir ( ) : void
return void

Close() public method

Closes the current connection, freeing resources.
public Close ( ) : void
return void

Connect() public method

Anonymous authentication
public Connect ( string hostname ) : string
hostname string
return string

Connect() public method

Anonymous authentication
public Connect ( string hostname, EsslSupportMode sslSupportMode ) : string
hostname string
sslSupportMode EsslSupportMode
return string

Connect() public method

public Connect ( string hostname, NetworkCredential credential ) : string
hostname string
credential System.Net.NetworkCredential
return string

Connect() public method

public Connect ( string hostname, NetworkCredential credential, EsslSupportMode sslSupportMode ) : string
hostname string
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
return string

Connect() public method

public Connect ( string hostname, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate ) : string
hostname string
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
userValidateServerCertificate RemoteCertificateValidationCallback
return string

Connect() public method

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.
public Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout ) : string
hostname string
port int
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
userValidateServerCertificate RemoteCertificateValidationCallback
x509ClientCert System.Security.Cryptography.X509Certificates.X509Certificate
sslMinKeyExchangeAlgStrength int
sslMinCipherAlgStrength int
sslMinHashAlgStrength int
timeout int Connection timeout in ms. null can be specifiad to keep the default value of 120s.
return string

Connect() public method

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.
public Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout, bool useCtrlEndPointAddressForData ) : string
hostname string
port int
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
userValidateServerCertificate RemoteCertificateValidationCallback
x509ClientCert System.Security.Cryptography.X509Certificates.X509Certificate
sslMinKeyExchangeAlgStrength int
sslMinCipherAlgStrength int
sslMinHashAlgStrength int
timeout int Connection timeout in ms. null can be specifiad to keep the default value of 120s.
useCtrlEndPointAddressForData bool true to use the control channel remote address for data connections instead of the address returned by PASV
return string

Connect() public method

Connects to a FTP server using the provided parameters. The default representation tipe is set to Binary. The text encoding is set to UTF8, if supported by the server via the FEAT command.
public Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int timeout, bool useCtrlEndPointAddressForData, EDataConnectionMode dataConnectionMode ) : string
hostname string
port int
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
userValidateServerCertificate RemoteCertificateValidationCallback
x509ClientCert System.Security.Cryptography.X509Certificates.X509Certificate
sslMinKeyExchangeAlgStrength int
sslMinCipherAlgStrength int
sslMinHashAlgStrength int
timeout int Connection timeout in ms. null can be specifiad to keep the default value of 120s.
useCtrlEndPointAddressForData bool true to use the control channel remote address for data connections instead of the address returned by PASV
dataConnectionMode EDataConnectionMode Active or Passive data connection mode
return string

Connect() public method

public Connect ( string hostname, int port, NetworkCredential credential, EsslSupportMode sslSupportMode, int timeout ) : string
hostname string
port int
credential System.Net.NetworkCredential
sslSupportMode EsslSupportMode
timeout int
return string

DeleteFile() public method

Deletes the given remote file.
public DeleteFile ( string remoteFileName ) : void
remoteFileName string
return void

Dispose() public method

public Dispose ( ) : void
return void

GetCurrentDirectory() public method

public GetCurrentDirectory ( ) : string
return string

GetDirectoryList() public method

public GetDirectoryList ( ) : IList
return IList

GetDirectoryList() public method

Returns a list of the contents form the given directory. A parsing is performed on the data returned fronm the LIST command.
Please use GetShortDirectoryList(string) or GetDirectoryListUnparsed(string) in case of parsing errors, as the contents returned from FTP servers may differ from the common DOS and UNIX formats adopted here.
public GetDirectoryList ( string remoteDirName ) : IList
remoteDirName string
return IList

GetDirectoryListUnparsed() public method

public GetDirectoryListUnparsed ( ) : string
return string

GetDirectoryListUnparsed() public method

returns the given directory list data as returned from the server, without parsing its contents.
public GetDirectoryListUnparsed ( string remoteDirName ) : string
remoteDirName string
return string

GetFeatures() public method

Features returned from the FEAT command
public GetFeatures ( ) : IList
return IList

GetFile() public method

Retrieves the given file from the server. A FtpStream is returned, to be read until the end of file. See the GetFile(string, string) overload to easily save the stream to a local file.
public GetFile ( string remoteFileName ) : FtpStream
remoteFileName string
return FtpStream

GetFile() public method

GetFile overload to easily transfer a file from remote to local
public GetFile ( string remoteFileName, string localFileName ) : ulong
remoteFileName string
localFileName string
return ulong

GetFile() public method

GetFile overload to easily transfer a file from remote to local
public GetFile ( string remoteFileName, string localFileName, FileTransferCallback transferCallback ) : ulong
remoteFileName string
localFileName string
transferCallback FileTransferCallback
return ulong

GetFileModificationTime() public method

Returns the modification time of the given remote file or null if the MDTM feature is not supported by the server.
public GetFileModificationTime ( string remoteFileName ) : DateTime?
remoteFileName string
return DateTime?

GetFileTransferSize() public method

Remote transfer file size returned by the SIZE command.
public GetFileTransferSize ( string remoteFileName ) : ulong?
remoteFileName string
return ulong?

GetFiles() public method

Transfers all files from the current remote directory without recursion
public GetFiles ( string localDirectoryName ) : void
localDirectoryName string
return void

GetFiles() public method

Transfers all files from the current remote directory. Optionally recursive
public GetFiles ( string localDirectoryName, bool recursive ) : void
localDirectoryName string
recursive bool
return void

GetFiles() public method

Transfers all files, matching the given pattern, from the current remote directory. Optionally recursive
public GetFiles ( string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive ) : void
localDirectoryName string
filePattern string
patternStyle EPatternStyle
recursive bool
return void

GetFiles() public method

Transfers all files, matching the given pattern, from the given remote directory. Optionally recursive
public GetFiles ( string remoteDirectoryName, string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive, FileTransferCallback transferCallback ) : void
remoteDirectoryName string Absolute or relative remote path, null indicates the current directory
localDirectoryName string Absolute local path
filePattern string May be null to transfer all files
patternStyle EPatternStyle
recursive bool
transferCallback FileTransferCallback
return void

GetShortDirectoryList() public method

public GetShortDirectoryList ( ) : IList
return IList

GetShortDirectoryList() public method

Returns an array of file names and directories contained in the given directory. Please use GetShortDirectoryList(string) or GetDirectoryListUnparsed(string) for more detailed directory information.
public GetShortDirectoryList ( string remoteDirName ) : IList
remoteDirName string
return IList

GetSystem() public method

Returns some remote system information, as returned from the SYST command.
public GetSystem ( ) : string
return string

MakeDir() public method

Creates the given remote directory.
public MakeDir ( string remoteDirName, bool recursive = false ) : void
remoteDirName string
recursive bool
return void

PopCurrentDirectory() public method

Restores the current directory. For details please see PushCurrentDirectory. Throws an exception if the stack is empty.
public PopCurrentDirectory ( ) : string
return string

PushCurrentDirectory() public method

Pushes the current remote directory on a stack, in order to easily restore it later calling PopCurrentDirectory.
public PushCurrentDirectory ( ) : string
return string

PutFile() public method

Stores a remote file, returning a FtpStream to be used for writing the file contents. Call FtpStream.Close on the stream once done. See the PutFile(string, string) overload to easily transfer the contents of a local file.
public PutFile ( string remoteFileName ) : FtpStream
remoteFileName string
return FtpStream

PutFile() public method

PutFile overload to easily transfer a file from local to remote
public PutFile ( string localFileName, string remoteFileName ) : ulong
localFileName string
remoteFileName string
return ulong

PutFile() public method

PutFile overload to easily transfer a file from local to remote
public PutFile ( string localFileName, string remoteFileName, FileTransferCallback transferCallback ) : ulong
localFileName string
remoteFileName string
transferCallback FileTransferCallback
return ulong

PutFiles() public method

Transfers all files to the current remote directory without recursion
public PutFiles ( string localDirectoryName ) : void
localDirectoryName string
return void

PutFiles() public method

Transfers all files to the current remote directory. Optionally recursive
public PutFiles ( string localDirectoryName, bool recursive ) : void
localDirectoryName string
recursive bool
return void

PutFiles() public method

Transfers all files, matching the given pattern, to the current remote directory. Optionally recursive
public PutFiles ( string localDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive ) : void
localDirectoryName string
filePattern string
patternStyle EPatternStyle
recursive bool
return void

PutFiles() public method

public PutFiles ( string localDirectoryName, string remoteDirectoryName, string filePattern, EPatternStyle patternStyle, bool recursive, FileTransferCallback transferCallback ) : void
localDirectoryName string
remoteDirectoryName string
filePattern string
patternStyle EPatternStyle
recursive bool
transferCallback FileTransferCallback
return void

PutUniqueFile() public method

public PutUniqueFile ( string &remoteFileName ) : FtpStream
remoteFileName string
return FtpStream

PutUniqueFile() public method

PutUniqueFile overload to easily transfer a file from local to remote
public PutUniqueFile ( string localFileName, string &remoteFileName ) : ulong
localFileName string
remoteFileName string
return ulong

PutUniqueFile() public method

PutUniqueFile overload to easily transfer a file from local to remote.
public PutUniqueFile ( string localFileName, string &remoteFileName, FileTransferCallback transferCallback ) : ulong
localFileName string
remoteFileName string
transferCallback FileTransferCallback
return ulong

RemoveDir() public method

Removes the given remote directory.
public RemoveDir ( string remoteDirName ) : void
remoteDirName string
return void

RenameFile() public method

Renames the given remote file.
public RenameFile ( string remoteFileNameFrom, string remoteFileNameTo ) : void
remoteFileNameFrom string
remoteFileNameTo string
return void

SendCustomCommand() public method

Sends the given FTP command text to the server.
In case of return codes >= 400 an exception is thrown.
public SendCustomCommand ( string command ) : FtpReply
command string
return FtpReply

SetCurrentDirectory() public method

Changes the remote current directory.
public SetCurrentDirectory ( string remoteDirName ) : void
remoteDirName string
return void

SetLanguage() public method

Set the language used by the server during the current connection. Please check the features returned by GetFeatues for a list of available languages supported by the server.
public SetLanguage ( string ietfLanguageTag ) : void
ietfLanguageTag string RFC 1766 language tag.
return void

SetTextEncoding() public method

Set the given text encoding.
public SetTextEncoding ( ETextEncoding textEncoding ) : void
textEncoding ETextEncoding
return void

SetTransferMode() public method

Set the representation type according to the given parameter
public SetTransferMode ( ETransferMode transferMode ) : void
transferMode ETransferMode
return void

StartKeepAlive() public method

Issues NOOP commands periodically in a separated thread
public StartKeepAlive ( ) : void
return void

StopKeepAlive() public method

Stops the keep alive thread
public StopKeepAlive ( ) : void
return void