Canceling File Transfer While Transferring a File to a Destination
I used Winscp to transfer files and got the file transfer details as below,
Mandatory file transfer data continuously until file is transferred to window using WPF
and the code transfer link below
https://winscp.net/eng/docs/library
But I need to cancel the file transfer. Please give your suggestion.
+3
source to share
2 answers
With WinSCP 5.10 beta, you can use FileTransferProgressEventArgs.Cancel
:
bool cancel = false; // set to true to cancel the transfer
session.FileTransferProgress +=
(sender, e) =>
{
if (cancel)
{
e.Cancel = true;
}
};
session.PutFiles(localPath, remotePath).Check();
0
source to share