Ftp Class
Namespace: Rebex.Net
Assembly: Rebex.Ftp.dll (version 7.0.9083)
Provides methods for communication with FTP servers.
Syntax
public class Ftp : NetworkSession, ILogWriterProvider, IFtp, IDisposable
Inherited Members
Remarks
All members of this class are thread-safe.
Constructors
Name | Description |
---|---|
Ftp() | Initializes a new instance of the Ftp class. |
Fields
Name | Description |
---|---|
DefaultImplicitSslPort | Default FTP/Implicit SSL port (990). |
DefaultPort | Default FTP port (21). |
Properties
Name | Description |
---|---|
AbortTimeout | Gets or sets the length of time before the abort operation times out. |
DataAddress | 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 IPAddress.None which means that the address of the listening interface is used instead. This has no effect for passive mode transfers. |
DataPortRange | Gets or sets the local TCP port range used for data transfers. This is usually only useful for active mode (see Passive), not in passive mode, where only the port range specified at the server is usually important. In passive mode, only set this property if you know precisely what you are doing, because setting it to a range that is too small or corresponds to the server range might often lead to inability to transfer many files. |
DefaultLogWriter | Gets or sets a default log writer used by all new instances of NetworkSession object. Inherited from NetworkSession. |
EnabledExtensions | Gets or sets the bit field specifying the enabled extensions. |
Encoding | Gets or sets the Encoding to use to encode and decode command parameters and server responses. |
InstanceId | Gets instance ID (intended for logging purposes). Inherited from NetworkSession. |
IsAuthenticated | Gets a value indicating whether the session is authenticated. |
IsBusy | Gets a value indicating whether there is any operation (method) in progress. |
IsConnected | Gets a value indicating whether the session is connected. |
IsSecured | Gets the value indicating whether the control connection is secured. |
LocalEndPoint | Gets the local client EndPoint. |
LogWriter | Gets or sets the LogWriter used by this object. Inherited from NetworkSession. |
MaxDownloadSpeed | Gets or sets the maximum allowed download speed, in kilobytes per second. For unlimited speed, set this to zero. |
MaxUploadSpeed | Gets or sets the maximum allowed upload speed, in kilobytes per second. For unlimited speed, set this to zero. |
Passive | Gets or sets a value which specifies the way data transfers are made. |
Proxy | Gets or sets the network proxy to use to access a remote server. |
RemoteEndPoint | Gets the remote server EndPoint. |
SecureTransfers | Gets or sets a value which specifies whether data transfers are secure. |
ServerName | Gets the server name, if available. Inherited from NetworkSession. |
ServerPort | Gets the server port, if available. Inherited from NetworkSession. |
Settings | Gets or sets FTP object settings. |
State | Gets the current state of the Ftp object. |
SupportedExtensions | Gets the bit field specifying the extensions supported by the server. |
Timeout | Gets or sets the length of time in milliseconds before the operation times out (specify -1 or 0 to indicate that the request does not time out). |
TlsSocket | Returns the TLS/SSL socket of secured control connection. |
TransferMode | Gets or sets the data transfer mode. |
TransferState | Gets the current transfer state of the Ftp object. |
TransferType | Gets or sets the data transfer type. |
UploadBufferLength | Gets or sets the size of the upload buffer. Allowed values are 2KB to 16MB. Default is 16KB (4KB on .NET CF). |
UserName | Gets the authenticated user name, if available. Inherited from NetworkSession. |
Version | Returns the version of the FTP component. |
Methods
Name | Description |
---|---|
Abort() | Aborts the current operation. |
AppendFile(Stream, String) | Appends the content of the data stream to the file on the server. |
AppendFile(Stream, String, Int64) | Appends the content of the data stream to the file on the server. |
AppendFile(String, String) | Appends the content of the local file to the file on the server. |
AppendFile(String, String, Int64, Int64) | Appends the content of the local file to the file on the server. |
AppendFileAsync(Stream, String, Int64, Object) | Begins asynchronous AppendFile operation. Appends the content of the data stream to the file on the server. |
AppendFileAsync(String, String, Int64, Int64, Object) | Begins asynchronous AppendFile operation. Appends the content of the local file to the file on the server. |
CalculateLocalChecksum(FtpChecksumType, Stream) | Calculates the checksum of the data in specified stream. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksum(FtpChecksumType, Stream, Int64) | Calculates the checksum of the data in specified stream. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksum(FtpChecksumType, String) | Calculates the checksum for the specified local file. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksum(FtpChecksumType, String, Int32, Int64) | Calculates the checksum for the specified local file. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksumAsync(FtpChecksumType, Stream, Int64, Object) | Begins asynchronous CalculateLocalChecksum operation. Calculates the checksum of the data in specified stream. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksumAsync(FtpChecksumType, Stream, Object) | Begins asynchronous CalculateLocalChecksum operation. Calculates the checksum of the data in specified stream. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksumAsync(FtpChecksumType, String, Int32, Int64, Object) | Begins asynchronous CalculateLocalChecksum operation. Calculates the checksum for the specified local file. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
CalculateLocalChecksumAsync(FtpChecksumType, String, Object) | Begins asynchronous CalculateLocalChecksum operation. Calculates the checksum for the specified local file. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) method instead. |
ChangeDirectory(String) | Changes the current working directory on the server. |
ChangeDirectoryAsync(String, Object) | Begins asynchronous ChangeDirectory operation. Changes the current working directory on the server. |
CheckConnectionState() | Checks whether the FTP session is still connected. Throws an exception on error. |
ClearCommandChannel() | Reverts the protected control connection back to plaintext connection. |
ClearCommandChannelAsync(Object) | Begins asynchronous ClearCommandChannel operation. Reverts the protected control connection back to plaintext connection. |
Connect(String) | Connects to the FTP server. |
Connect(String, SslMode) | Connects to the FTP server with the specified security. Use a port corresponding to the specified security mode. |
Connect(String, Int32) | Connects to the FTP server. |
Connect(String, Int32, SslMode) | Connects to the FTP server with the specified security. |
ConnectAsync(String, SslMode, Object) | Begins asynchronous Connect operation. Connects to the FTP server with the specified security. Use a port corresponding to the specified security mode. |
ConnectAsync(String, Int32, SslMode, Object) | Begins asynchronous Connect operation. Connects to the FTP server with the specified security. |
ConnectAsync(String, Int32, Object) | Begins asynchronous Connect operation. Connects to the FTP server. |
ConnectAsync(String, Object) | Begins asynchronous Connect operation. Connects to the FTP server. |
CopyToAnotherServer(Ftp, String, String) | Copies a file on this FTP server to another server using direct server-to-server transfer, also known as FXP. |
CopyToAnotherServerAsync(Ftp, String, String, Object) | Begins asynchronous CopyToAnotherServer operation. Copies a file on this FTP server to another server using direct server-to-server transfer, also known as FXP. |
CreateDirectory(String) | Creates a directory on the server. |
CreateDirectoryAsync(String, Object) | Begins asynchronous CreateDirectory operation. Creates a directory on the server. |
Delete(FileSet) | Deletes the specified files and/or directories at the FTP server. |
Delete(String, TraversalMode) | Deletes the specified files and/or directories at the FTP server. |
DeleteAsync(FileSet, Object) | Begins asynchronous Delete operation. Deletes the specified files and/or directories at the FTP server. |
DeleteAsync(String, TraversalMode, Object) | Begins asynchronous Delete operation. Deletes the specified files and/or directories at the FTP server. |
DeleteFile(String) | Deletes the file on the server. |
DeleteFileAsync(String, Object) | Begins asynchronous DeleteFile operation. Deletes the file on the server. |
DirectoryExists(String) | Detects whether the specified directory exists on the server. Not all FTP servers support this! |
DirectoryExistsAsync(String, Object) | Begins asynchronous DirectoryExists operation. Detects whether the specified directory exists on the server. Not all FTP servers support this! |
Disconnect() | Informs the server that the connection is about to close and terminates the connection. |
DisconnectAsync(Object) | Begins asynchronous Disconnect operation. Informs the server that the connection is about to close and terminates the connection. |
Dispose() | Disposes the Ftp object and all the socket objects. |
Dispose(Boolean) | Releases the unmanaged resources used by the Ftp and optionally releases the managed resources. |
Download(FileSet, String) | Downloads the specified files and/or directories from the FTP server to the local directory. |
Download(FileSet, String, TransferMethod, ActionOnExistingFiles) | Downloads the specified files and/or directories from the FTP server to the local directory. |
Download(String, String) | Downloads the specified file or directory hierarchy from the FTP server to the local directory. Accepts wildcards. |
Download(String, String, TraversalMode) | Downloads the specified file or directory hierarchy from the FTP server to the local directory. Accepts wildcards. |
Download(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles) | Downloads the specified file or directory hierarchy from the FTP server to the local directory. Accepts wildcards. |
DownloadAsync(FileSet, String, TransferMethod, ActionOnExistingFiles, Object) | Begins asynchronous Download operation. Downloads the specified files and/or directories from the FTP server to the local directory. |
DownloadAsync(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles, Object) | Begins asynchronous Download operation. Downloads the specified file or directory hierarchy from the FTP server to the local directory. Accepts wildcards. |
FileExists(String) | Detects whether the specified file exists on the server. Not all FTP servers support this! |
FileExistsAsync(String, Object) | Begins asynchronous FileExists operation. Detects whether the specified file exists on the server. Not all FTP servers support this! |
Finalize() | Finalizer. Called by garbage collector during object destruction. |
Flush(Int32) | Reads and returns control connection data, if available. |
GetChecksum(String, ChecksumAlgorithm) | Returns the checksum of the specified file on the server. |
GetChecksum(String, ChecksumAlgorithm, Int64, Int64) | Returns the checksum of the specified file on the server. |
GetChecksumAsync(String, ChecksumAlgorithm, Int64, Int64, Object) | Begins asynchronous GetChecksum operation. Returns the checksum of the specified file on the server. |
GetChecksumAsync(String, ChecksumAlgorithm, Object) | Begins asynchronous GetChecksum operation. Returns the checksum of the specified file on the server. |
GetConnectionState() | Checks whether the FTP session is still connected and returns its state. |
GetCurrentDirectory() | Gets the absolute path of the current working directory on the remote server. |
GetCurrentDirectoryAsync(Object) | Begins asynchronous GetCurrentDirectory operation. Gets the absolute path of the current working directory on the remote server. |
GetDownloadStream(String) | Returns a Stream for reading data from the remote file. |
GetDownloadStream(String, SeekOrigin, Int64) | Returns a Stream for reading data from the remote file. |
GetDownloadStreamAsync(String, SeekOrigin, Int64, Object) | Begins asynchronous GetDownloadStream operation. Returns a Stream for reading data from the remote file. |
GetFile(String, Stream) | Downloads the remote file to the data stream. |
GetFile(String, Stream, Int64) | Downloads the remote file to the data stream. |
GetFile(String, String) | Downloads the remote file to the local file. |
GetFile(String, String, Int64, Int64) | Downloads the remote file to the local file. |
GetFileAsync(String, Stream, Int64, Object) | Begins asynchronous GetFile operation. Downloads the remote file to the data stream. |
GetFileAsync(String, Stream, Object) | Begins asynchronous GetFile operation. Downloads the remote file to the data stream. |
GetFileAsync(String, String, Int64, Int64, Object) | Begins asynchronous GetFile operation. Downloads the remote file to the local file. |
GetFileAsync(String, String, Object) | Begins asynchronous GetFile operation. Downloads the remote file to the local file. |
GetFileDateTime(String) | Returns the modification date and time of the specified remote file. |
GetFileDateTimeAsync(String, Object) | Begins asynchronous GetFileDateTime operation. Returns the modification date and time of the specified remote file. |
GetFileLength(String) | Returns the size of the specified remote file. |
GetFileLengthAsync(String, Object) | Begins asynchronous GetFileLength operation. Returns the size of the specified remote file. |
GetHashCode() | Gets hash code for this object. Inherited from NetworkSession. |
GetItems(FileSet) | Returns parsed list of files and directories specified by the |
GetItems(String) | Returns parsed list of files and directories. Matching directories are searched recursively. |
GetItems(String, TraversalMode) | Returns parsed list of files and directories. |
GetItemsAsync(FileSet, Object) | Begins asynchronous GetItems operation.
Returns parsed list of files and directories specified by the |
GetItemsAsync(String, TraversalMode, Object) | Begins asynchronous GetItems operation. Returns parsed list of files and directories. |
GetList() | Returns parsed list of files and directories in the current server directory. |
GetList(String) | Returns parsed list of files and directories. |
GetListAsync(Object) | Begins asynchronous GetList operation. Returns parsed list of files and directories in the current server directory. |
GetListAsync(String, Object) | Begins asynchronous GetList operation. Returns parsed list of files and directories. |
GetNameList() | Retrieves the list of names in the current server directory. |
GetNameList(String) | Retrieves the list of names. |
GetNameListAsync(Object) | Begins asynchronous GetNameList operation. Retrieves the list of names in the current server directory. |
GetNameListAsync(String, Object) | Begins asynchronous GetNameList operation. Retrieves the list of names. |
GetRawList() | Retrieves the raw list of files and directories in the current server directory as received from the server. |
GetRawList(String) | Retrieves the raw list of files and directories as received from the server. |
GetRawList(String, FtpListingType) | Retrieves the raw list of files and directories as received from the server. |
GetRawListAsync(Object) | Begins asynchronous GetRawList operation. Retrieves the raw list of files and directories in the current server directory as received from the server. |
GetRawListAsync(String, FtpListingType, Object) | Begins asynchronous GetRawList operation. Retrieves the raw list of files and directories as received from the server. |
GetRawListAsync(String, Object) | Begins asynchronous GetRawList operation. Retrieves the raw list of files and directories as received from the server. |
GetRemoteChecksum(FtpChecksumType, String) | Returns the checksum of the specified file on the server. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) instead. |
GetRemoteChecksum(FtpChecksumType, String, Int32, Int64) | Returns the checksum of the specified file on the server. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm, Int64, Int64) instead. |
GetRemoteChecksumAsync(FtpChecksumType, String, Int32, Int64, Object) | Begins asynchronous GetRemoteChecksum operation. Returns the checksum of the specified file on the server. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm, Int64, Int64) instead. |
GetRemoteChecksumAsync(FtpChecksumType, String, Object) | Begins asynchronous GetRemoteChecksum operation. Returns the checksum of the specified file on the server. This method will be deprecated. Please use GetChecksum(String, ChecksumAlgorithm) instead. |
GetSupportedChecksumAlgorithms() | Returns checksum algorithms supported by the server. |
GetSupportedChecksumTypes() | Returns checksum types supported by the server. This method will be deprecated. Please use GetSupportedChecksumAlgorithms() method instead. |
GetSystemName() | Returns the name of the remote OS. |
GetSystemNameAsync(Object) | Begins asynchronous GetSystemName operation. Returns the name of the remote OS. |
GetUploadStream(String) | Returns a Stream for writing data to the remote file. |
GetUploadStream(String, SeekOrigin, Int64) | Returns a Stream for writing data to the remote file. |
GetUploadStreamAsync(String, SeekOrigin, Int64, Object) | Begins asynchronous GetUploadStream operation. Returns a Stream for writing data to the remote file. |
KeepAlive() | Sends the NOOP command to the server to keep the connection alive. |
KeepAliveAsync(Object) | Begins asynchronous KeepAlive operation. Sends the NOOP command to the server to keep the connection alive. |
Login(String, String) | Authenticates the user to the FTP server. |
Login(String, String, String) | Authenticates the user to the FTP server. |
LoginAsync(String, String, Object) | Begins asynchronous Login operation. Authenticates the user to the FTP server. |
LoginAsync(String, String, String, Object) | Begins asynchronous Login operation. Authenticates the user to the FTP server. |
OnCommandSent(FtpCommandSentEventArgs) | Raises the CommandSent event. |
OnResponseRead(FtpResponseReadEventArgs) | Raises the ResponseRead event. |
OnStateChanged(FtpStateChangedEventArgs) | Raises the Rebex.Net.Ftp.StateChanged event. |
OnTransferProgress(FtpTransferProgressEventArgs) | Raises the Rebex.Net.Ftp.TransferProgress event. |
PutFile(Stream, String) | Uploads the content of the data stream to the file on the server, overriding it if it already exists. |
PutFile(Stream, String, Int64, Int64) | Uploads the content of the data stream to the file on the server. |
PutFile(String, String) | Uploads the content of the local file to the file on the server, overriding it if it already exists. |
PutFile(String, String, Int64, Int64, Int64) | Uploads the content of the local file to the file on the server. |
PutFileAsync(Stream, String, Int64, Int64, Object) | Begins asynchronous PutFile operation. Uploads the content of the data stream to the file on the server. |
PutFileAsync(Stream, String, Object) | Begins asynchronous PutFile operation. Uploads the content of the data stream to the file on the server, overriding it if it already exists. |
PutFileAsync(String, String, Int64, Int64, Int64, Object) | Begins asynchronous PutFile operation. Uploads the content of the local file to the file on the server. |
PutFileAsync(String, String, Object) | Begins asynchronous PutFile operation. Uploads the content of the local file to the file on the server, overriding it if it already exists. |
PutUniqueFile(Stream) | Uploads the content of the stream to the file with unique pathname on the server. |
PutUniqueFile(String) | Uploads the content of the local file to the file with unique pathname on the server. |
PutUniqueFileAsync(Stream, Object) | Begins asynchronous PutUniqueFile operation. Uploads the content of the stream to the file with unique pathname on the server. |
PutUniqueFileAsync(String, Object) | Begins asynchronous PutUniqueFile operation. Uploads the content of the local file to the file with unique pathname on the server. |
ReadResponse() | Returns the response of the FTP server to the command. |
ReadResponseAsync(Object) | Begins asynchronous ReadResponse operation. Returns the response of the FTP server to the command. |
RemoveDirectory(String) | Deletes an empty remote directory with the specified pathname. |
RemoveDirectoryAsync(String, Object) | Begins asynchronous RemoveDirectory operation. Deletes an empty remote directory with the specified pathname. |
Rename(String, String) | Renames or moves a file or directory on the server. |
RenameAsync(String, String, Object) | Begins asynchronous Rename operation. Renames or moves a file or directory on the server. |
Secure() | Secures the connection with TLS/SSL. |
SecureAsync(Object) | Begins asynchronous Secure operation. Secures the connection with TLS/SSL. |
SendCommand(String) | Executes a command on the FTP server. |
SendCommandAsync(String, Object) | Begins asynchronous SendCommand operation. Executes a command on the FTP server. |
SetFileDateTime(String, DateTime) | Sets the modification date and time of the specified remote file. Not all FTP servers support this! |
SetFileDateTimeAsync(String, DateTime, Object) | Begins asynchronous SetFileDateTime operation. Sets the modification date and time of the specified remote file. Not all FTP servers support this! |
SetSocketFactory(ISocketFactory) | Sets the socket factory to be used to create communication sockets. |
Site(String) | Executes site-specific command and returns the response. |
SiteAsync(String, Object) | Begins asynchronous Site operation. Executes site-specific command and returns the response. |
ToString() | Returns a string representation of this object. |
Upload(FileSet, String) | Uploads the specified local files and/or directories to the directory on the FTP server. |
Upload(FileSet, String, TransferMethod, ActionOnExistingFiles) | Uploads the specified local files and/or directories to the directory on the FTP server. |
Upload(String, String) | Uploads the specified local file or directory hierarchy to the directory to the FTP server. Accepts wildcards. |
Upload(String, String, TraversalMode) | Uploads the specified local file or directory hierarchy to the directory to the FTP server. Accepts wildcards. |
Upload(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles) | Uploads the specified local file or directory hierarchy to the directory on the FTP server. Accept wildcards. |
UploadAsync(FileSet, String, TransferMethod, ActionOnExistingFiles, Object) | Begins asynchronous Upload operation. Uploads the specified local files and/or directories to the directory on the FTP server. |
UploadAsync(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles, Object) | Begins asynchronous Upload operation. Uploads the specified local file or directory hierarchy to the directory on the FTP server. Accept wildcards. |
Events
Name | Description |
---|---|
CommandSent | Occurs when a command is send to the server. |
DeleteProgressChanged | Occurs when a significant action occurs in Delete method. Notifies the client about currently processing directory, currently deleting file and progress of the delete. |
ListItemReceived | Occurs when a file and directory listing item is received by the GetList(), GetRawList() or GetNameList() or GetItems methods. |
ProblemDetected | Occurs when a problem is detected in Download, Upload, Delete or GetItems methods, making it possible for the handler to choose a desired reaction. |
ResponseRead | Occurs when a response is received from the server. |
TransferProgressChanged | Occurs when a significant action occurs in Download, Upload methods. Notifies the client about currently processing directory, currently transferring file and progress of the transfer. |
Traversing | Occurs when a significant action occurs in Download, Upload, Delete or GetItems methods. Notifies the client about traversing hierarchy structure. |
ValidatingCertificate | Occurs when a server certificate needs to be validated. |
Explicit Interface Implementations
Name | Description |
---|---|
IFtp.DeleteProgressChanged | Occurs when a significant action occurs in Delete(String, TraversalMode) method. Notifies the client about currently processing directory, currently deleting file and progress of the delete. |
IFtp.Disconnect() | Informs the server that the connection is about to close and terminates the connection. |
IFtp.DisconnectAsync(Object) | Informs the server that the connection is about to close and terminates the connection. |
IFtp.GetInfo(String, Boolean) | Retrieves a FileSystemItem containing the information about the specified remote file or directory. |
IFtp.GetInfoAsync(String, Boolean, Object) | Retrieves a FileSystemItem containing the information about the specified remote file or directory. |
IFtp.GetItems(FileSet) | Retrieves the list of files and directories specified by the |
IFtp.GetItems(String) | Retrieves the list of files and directories. Matching directories are searched recursively. |
IFtp.GetItems(String, TraversalMode) | Retrieves the list of files and directories. |
IFtp.GetItemsAsync(FileSet, Object) | Retrieves the list of files and directories specified by the |
IFtp.GetItemsAsync(String, TraversalMode, Object) | Retrieves the list of files and directories. |
IFtp.GetList() | Retrieves the list of files and directories in the current server directory. |
IFtp.GetList(String) | Retrieves the list of files and directories in the current server directory. |
IFtp.GetListAsync(Object) | Retrieves the list of files and directories in the current server directory. |
IFtp.GetListAsync(String, Object) | Retrieves the list of files and directories in the current server directory. |
IFtp.ListItemReceived | Occurs when a file and directory listing item is received by the GetList(), GetRawList(), GetNameList() or GetItems(String) methods. Notifies the client about currently processed item. |
IFtp.Login(String, String) | Authenticates the user to the server. |
IFtp.LoginAsync(String, String, Object) | Authenticates the user to the server. |
IFtp.ProblemDetected | Occurs when a problem is detected in Download(String, String), Upload(String, String), Delete(String, TraversalMode) or GetItems(String) methods, making it possible for the handler to choose a desired reaction. |
IFtp.Settings | Gets the options set used by this object. |
IFtp.TransferProgressChanged | Occurs when a significant action occurs in Download(String, String), Upload(String, String) methods. Notifies the client about currently processing directory, currently transferring file and progress of the transfer. |
IFtp.TransferType | Gets or sets the data transfer type. |
IFtp.Traversing | Occurs when a significant action occurs in Download(String, String), Upload(String, String), Delete(String, TraversalMode) or GetItems(String) methods. Notifies the client about traversing hierarchy structure. |