Transfer Event
Fired during file download/upload.
Syntax
public event OnTransferHandler OnTransfer; public delegate void OnTransferHandler(object sender, SftpTransferEventArgs e); public class SftpTransferEventArgs : EventArgs { public int Direction { get; } public string LocalFile { get; } public string RemoteFile { get; } public long BytesTransferred { get; } public int PercentDone { get; } public string Text { get; }
public byte[] TextB { get; } public bool Cancel { get; set; } }
Public Event OnTransfer As OnTransferHandler Public Delegate Sub OnTransferHandler(sender As Object, e As SftpTransferEventArgs) Public Class SftpTransferEventArgs Inherits EventArgs Public ReadOnly Property Direction As Integer Public ReadOnly Property LocalFile As String Public ReadOnly Property RemoteFile As String Public ReadOnly Property BytesTransferred As Long Public ReadOnly Property PercentDone As Integer Public ReadOnly Property Text As String
Public ReadOnly Property TextB As Byte() Public Property Cancel As Boolean End Class
Remarks
One or more Transfer events are fired during file transfer. The BytesTransferred parameter shows the number of bytes transferred since the beginning of the transfer.
Text contains the portion of the file data being delivered.
The Direction parameter shows whether the client (0) or the server (1) is sending the data.
LocalFile identifies the local file. RemoteFile is the remote file.
The PercentDone parameter shows the progress of the transfer in the corresponding direction. If PercentDone can not be calculated the value will be -1.
To cancel the current transfer set Cancel to true.