'Declaration Public Event FileTransferStatus As FileTransferStatusEventHandler
'Usage Dim instance As FtpClient Dim handler As FileTransferStatusEventHandler AddHandler instance.FileTransferStatus, handler
public event FileTransferStatusEventHandler FileTransferStatus
The event handler receives an argument of type FileTransferStatusEventArgs containing data related to this event. The following FileTransferStatusEventArgs properties provide information specific to this event.
Property | Description |
---|---|
AllBytesPercent | Gets the percentage of the bytes that have been transferred for the entire group of files to transfer. |
AllBytesPerSecond | Gets the average throughput for the entire group of files being transferred, in bytes per second. |
AllBytesSkipped | Gets the total amount of bytes that were skipped so far for the group of files being transferred. |
AllBytesTotal | Gets the total amount of bytes of all files that will be transferred. |
AllBytesTransferred | Gets the total amount of bytes transferred so far for the group of files being transferred. |
BytesPercent | Gets the percentage of bytes transferred for the current file. |
BytesPerSecond | Gets the current file's average throughput in bytes per second. |
BytesSkipped | Gets the amount of bytes that were skipped for the current file. |
BytesTotal | Gets the total amount of bytes for the current file. |
BytesTransferred | Gets the amount of bytes transferred for the current file. |
FilesPercent | Gets the percentage of files that have been transferred so far. |
FilesSkipped | Gets the total number of files skipped so far. |
FilesTotal | Gets the total number of files to transfer. |
FilesTransferred | Gets the total number of files transferred so far. |
LocalFilename | Gets the path and filename of the local file. |
RemoteFilename | Gets the filename of the remote file. |
Xceed.Ftp.Licenser.LicenseKey = "FTNXX-XXXXX-XXXXX-XXXX" ' Set license key here to deploy Dim ftp As New FtpClient() ' Subscribe to the FileTransferStatus event. AddHandler ftp.FileTransferStatus, AddressOf Me.file_transfer ftp.Connect( "localhost" ) ftp.Login() ftp.ReceiveMultipleFiles( "ClientFiles\*", "d:\", True, True ) ftp.Disconnect() Private Sub file_transfer( ByVal sender As Object, ByVal e As FileTransferStatusEventArgs ) If e.BytesTransferred = 0 Then label2.Text = "Receiving file " + e.LocalFilename label1.Text = "Receiving file #" + e.FilesTransferred.ToString() + " of " + e.FilesTotal.ToString() label1.Refresh() label2.Refresh() End If progressBar2.Value = e.BytesPercent progressBar1.Value = e.AllBytesPercent End Sub
Xceed.Ftp.Licenser.LicenseKey = "FTNXX-XXXXX-XXXXX-XXXX" // Set license key here to deploy FtpClient ftp = new FtpClient(); // Subscribe to the FileTransferStatus event. ftp.FileTransferStatus += new FileTransferStatusEventHandler( this.file_transfer ); ftp.Connect( "localhost" ); ftp.Login(); ftp.ReceiveMultipleFiles( @"ClientFiles\*", @"d:\", true, true ); ftp.Disconnect(); private void file_transfer( object sender, FileTransferStatusEventArgs e ) { if( e.BytesTransferred == 0 ) { label2.Text = "Receiving file " + e.LocalFilename; label1.Text = "Receiving file #" + e.FilesTransferred.ToString() + " of " + e.FilesTotal.ToString(); label1.Refresh(); label2.Refresh(); } progressBar2.Value = e.BytesPercent; progressBar1.Value = e.AllBytesPercent; }
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