Xceed .NET Libraries Documentation
Xceed.Ftp Assembly / Xceed.Ftp Namespace / FtpConnection Class
Members


In This Topic
    FtpConnection Class
    In This Topic
    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

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets a value indicating whether to clear the command channel after login to facilitate firewall NAT when using a secure data channel.  
    Public Property  
    Public PropertyGets or sets the default value indicating how the data is transferred to and from the FTP server.  
    Public PropertyGets or sets the System.Text.Encoding that is used to encode commands sent to the server, and decode replies and folder listings received from the server.  
    Public PropertyGets or sets a Boolean value indicating if FXP file transfers use the passive method or not to initiate the data connection.  
    Public PropertyGets or sets a FxpTransferPolicy value that indicates if FXP file transfers are allowed and what kind of transfers can be made.  
    Public PropertyGets the hostname of the FTP server to which a connection has been established.  
    Public PropertyGets or sets the interval, in seconds, at which a NOOP command is sent on the command channel while idle or during a file transfer.  
    Public PropertyGets or sets the ListingMethod that will be used to retrieve folder contents from the FTP server.  
    Public PropertyGets a collection of FtpListingParser objects that are used to parse the lines returned by calls to various methods.  
    Public PropertyGets or sets the client-side IP address and port.  
    Public PropertyGets or sets the IP address and port of the client-side data connection to use in subsequent data connections. If PassiveTransfer is false, this property represents the address of the client-side listening socket waiting for the server’s data connection request.  
    Public PropertyGets or sets a boolean value indicating whether the data connection should be established by the FTP server rather than by the client-side.  
    Public PropertyGets the password used to connect to the FTP server.  
    Public PropertyGets the port of the FTP server to which a connection has been established.  
    Public PropertyGets or sets a boolean value indicating if the FTP server must reserve enough space before a file is sent.  
    Public PropertyGets or sets the active proxy client for connecting to the FTP server.  
    Public Property  
    Public PropertyGets or sets a boolean value indicating if the TYPE command should be sent before initiating a file transfer.  
    Public PropertyGets the IP address and port of the FTP server to which a connection has been established.  
    Public PropertyGets or sets the FTP server's folder separator character.  
    Public PropertyGets or sets the object used to automatically redirect events on the main UI thread.  
    Public PropertyGets or sets a value, in seconds, indicating after what period of time an FTP operation should timeout.  
    Public PropertyGets or sets the System.IO.TextWriter which will trace the communications between the client-side and the FTP server.  
    Public Property  
    Public Property  
    Public Property  
    Public PropertyGets or sets the transfer mode used to send and receive data to and from an FTP server.  
    Public PropertyGets or sets a value indicating whether to use the remote address.  
    Public PropertyGets the username used to connect to the FTP server.  
    Top
    Public Methods
     NameDescription
    Public MethodClose any pending connections.  
    Public MethodRelease all cached connections.  
    Public MethodTests if a connection with the specified FTP server is possible before the FtpConnection instance is passed to FtpFile or FtpFolder objects.  
    Top
    Protected Methods
     NameDescription
    Protected MethodAllows the FtpConnection object to attempt to free resources and perform other cleanup operations before it is reclaimed by garbage collection.  
    Top
    Public Events
     NameDescription
    Public EventRaised when an FTP server's certificate has been received and verified. Note: This event is not available in Xceed FTP for .NET Compact Framework because this product does not support Secure FTP.  
    Public EventRaised when a client certificate is required by the FTP server, or the one provided (if e.Certificate is not NULL) was rejected.  
    Public EventRaised when a listing line is received from the FTP server.  
    Top
    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