Xceed .NET Libraries Documentation
Xceed.Ftp Assembly / Xceed.Ftp Namespace / FtpClient Class / Disconnected Event
Example


    Disconnected Event (FtpClient)
    Raised when the Disconnect method is called as well as when the connection is terminated by the FTP server.
    Syntax
    'Declaration
     
    Public Event Disconnected As EventHandler
     
    'Usage
     
    Dim instance As FtpClient
    Dim handler As EventHandler
     
    AddHandler instance.Disconnected, handler
    Example
    The following example demonstrates how to use the Disconnected event to display a messagebox when the FTP client is disconnected from the FTP server. This example assumes that you are in a Windows application.
    Xceed.Ftp.Licenser.LicenseKey = "FTNXX-XXXXX-XXXXX-XXXX" ' Set license key here to deploy 
    
    Dim ftp As New FtpClient()
    
    AddHandler ftp.Disconnected, AddressOf Me.disconnected
    
    ftp.Connect( "localhost" )
    ftp.Login()
    
    ftp.GetFolderContents()
    
    ftp.Disconnect()
    
    Private Sub disconnected( ByVal sender As Object, ByVal e As EventArgs )
    
      MessageBox.Show( "You are no longer connected to the FTP server!" )
    End Sub
    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