'Declaration Public Event ReceivingFile As TransferringFileEventHandler
'Usage Dim instance As FtpClient Dim handler As TransferringFileEventHandler AddHandler instance.ReceivingFile, handler
public event TransferringFileEventHandler ReceivingFile
Event Data
The event handler receives an argument of type TransferringFileEventArgs containing data related to this event. The following TransferringFileEventArgs properties provide information specific to this event.
Property | Description |
---|---|
LocalFilename | Gets the path and filename of the local file. |
RemoteFilename | Gets the filename of the remote file. |
Remarks
Example
The following example demonstrates how to use the ReceivingFile event to display the name of the
file(s) being received from the FTP server.
This example assumes that you are in a Windows application and that the form contains a listbox.
Xceed.Ftp.Licenser.LicenseKey = "FTNXX-XXXXX-XXXXX-XXXX" ' Set license key here to deploy Dim ftp As New FtpClient() AddHandler ftp.ReceivingFile, AddressOf Me.receiving_file ftp.Connect( "localhost" ) ftp.Login() ftp.ReceiveMultipleFiles( "ClientFiles\*", "d:\", True, True ) ftp.Disconnect() Private Sub receiving_file( ByVal sender As object, ByVal e As TransferringFileEventArgs ) listBox1.Items.Add( "RECEIVING " + e.RemoteFilename.ToUpper() + " TO " + e.LocalFilename.ToUpper() ) listBox1.Refresh() End Sub
Xceed.Ftp.Licenser.LicenseKey = "FTNXX-XXXXX-XXXXX-XXXX" // Set license key here to deploy FtpClient ftp = new FtpClient(); ftp.ReceivingFile += new TransferringFileEventHandler( this.receiving_file ); ftp.Connect( "localhost" ); ftp.Login(); ftp.ReceiveMultipleFiles( @"ClientFiles\*", @"d:\", true, true ); ftp.Disconnect(); private void receiving_file( object sender, TransferringFileEventArgs e ) { listBox1.Items.Add( "RECEIVING " + e.RemoteFilename.ToUpper() + " TO " + e.LocalFilename.ToUpper() ); listBox1.Refresh(); }
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