Assembly: edtFTPnetPRO (in edtFTPnetPRO.dll) Version: 9.4.0.40
Syntax
C# |
---|
[SerializableAttribute] public class ExFTPConnection : FTPConnection, ICloneable, IXmlSerializable, ISerializable |
Visual Basic |
---|
<SerializableAttribute> _ Public Class ExFTPConnection _ Inherits FTPConnection _ Implements ICloneable, IXmlSerializable, ISerializable |
Visual C++ |
---|
[SerializableAttribute] public ref class ExFTPConnection : public FTPConnection, ICloneable, IXmlSerializable, ISerializable |
Remarks
ExFTPConnection provides a range of advanced features that save development time and improve the quality of applications using FTP. These features include:
- Multi-file operations: - Methods such as DownloadMultiple(String, String) and DeleteDirectoryTree(String) enable the developer to execute FTP operations on multiple files and directories with a single line of code.
- Asynchronous methods: - These are virtually essential when writing GUI application since they vastly improve responsiveness by executing time-consuming FTP operations in the background.
- Visual design tools: - ExFTPConnection integrates with Visual Studio and other IDEs to provide design-time tools that make FTP development easier. For example, the Connection Tester allows the developer to test their ExFTPConnection properties by connecting to an FTP server from within the development environment.
- Proxy support: - FTP operations may be performed through SOCKS4, SOCKS4A, SOCKS5 and HTTP proxies.
ExFTPConnection also provides the connectivity for our range of FTP Visual Controls, which are .NET GUI Controls that can be dropped onto Windows Forms to add sophisticated visual FTP application features with virtually no programming.
Multi-file Operations are methods that operate on multiple files. Operations that can be done of multiple files are:
- Download of files matching a wildcard (see DownloadMultiple(String, String) and DownloadMultiple(String, String, String, Boolean)).
- Download of files matching a user-defined FileFilter (see DownloadMultiple(String, FileFilter) and DownloadMultiple(String, String, FileFilter, Boolean)).
- Upload of files matching a wildcard (see UploadMultiple(String, String) and UploadMultiple(String, String, String, Boolean)).
- Upload of files matching a user-defined FileFilter (see UploadMultiple(String, FileFilter) and UploadMultiple(String, String, FileFilter, Boolean)).
- Deletion of files matching a wildcard (see DeleteMultipleFiles(String) and DeleteMultipleFiles(String, String, Boolean)).
- Deletion of files matching a user-defined FileFilter (see DeleteMultipleFiles(FileFilter) and DeleteMultipleFiles(String, FileFilter, Boolean)).
- Deletion of directory trees (see DeleteDirectoryTree(String)).
Asynchronous Methods are supported by means of a large number of Begin___() and End___() methods. Nearly every synchronous method offered in FTPConnectionand ExFTPConnection has matching asynchronous operations in the form of a matching Begin___() and End___() pair of methods. The following example illustrates the use of BeginDownloadFile(String, String, AsyncCallback, Object)
Copy | |
---|---|
private void button1_Click(object sender, System.EventArgs e) { exFTPConnection1.BeginDownloadFile(fileName, fileName, new AsyncCallback(DownloadComplete), fileName); } private void DownloadComplete(IAsyncResult ar) { exFTPConnection1.EndDownloadFile(ar); label1.Text = "Finished downloading " + (string)ar.AsyncState; } |
Each Begin___() method returns an IAsyncResult reference, which may be cast to FTPTask. FTPTask contains an identifier called TaskID, which uniquely identifies the method-call. Information about the task may also be obtained through this object. The task may be cancelled by calling the CancelTask(IAsyncResult) method with the given task ID.
When Concurrent transfers are [!:ConcurrentTransferSettings.Enabled] multiple files may be transferred at the same time. This is achieved by maintaining a set of connections (called a "connection pool"). Each connection in the pool may transfer one file at a time, so the maximum number of files that may be transferred simultaneously is equal to the size of the pool ([!:ConcurrentTransferSettings.MaxConnections].
The Connection Tester may be used to assist with setting the properties of ExFTPConnection. It allows the developer to test various property-settings interactively without running their application. The Connection Tester may be accessed by (1) double-clicking on the component, (2) right-clicking on the component and selecting "Connection Designer" from the context menu, or (3) selecting the component and then clicking on the "Connection Tester" link at the bottom of the Properties View.
Proxy Settings may be controlled through the ProxySettings property.
Inheritance Hierarchy
System..::..MarshalByRefObject
System.ComponentModel..::..Component
EnterpriseDT.Net.Ftp..::..FTPConnection
EnterpriseDT.Net.Ftp..::..ExFTPConnection
EnterpriseDT.Net.Ftp..::..SecureFTPConnection