Xceed .NET Libraries Documentation
FtpConnection Class
Members 


Xceed.Ftp Assembly > Xceed.Ftp Namespace : FtpConnection Class
Class which represents the connection between a client and an FTP server.
Syntax
'Declaration
 
Public NotInheritable Class FtpConnection 
   Implements System.IDisposable 
'Usage
 
Dim instance As FtpConnection
public sealed class FtpConnection : System.IDisposable  
Remarks

The FtpConnection class implements the System.IDisposable interface meaning that every FtpConnection object that is created should also be disposed of by calling the Dispose method or, in C#, creating the FtpConnection within a using block. If an instance of an FtpConnection object is not disposed of, connections with the FTP server may remain active until the FTP server times-out or the garbage-collector passes.

The FtpConnection will create connections with the FTP server transparently and as necessary until it is disposed of or garbage-collected. To prevent connections with an FTP server from being kept alive, the CloseConnections method can be called. The CloseConnections method will close any connections that are not being used, however the FtpConnection instance will remain usable.

To test if a connection with the specified FTP server is possible before the FtpConnection instance is passed to FtpFile or FtpFolder objects, the TestConnection method can be used. If a connection with an FTP server is not possible, exceptions will be thrown when trying to access properties of the FtpFile and/or FtpFolder instances.

Inheritance Hierarchy

System.Object
   Xceed.Ftp.FtpConnection

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FtpConnection Members
Xceed.Ftp Namespace