Reputation: 279
I have used Winscp for file transferring and got details file transfer progress like below link,
File transfer details binding continuously until file transfered in window using WPF
and transfer code link below
https://winscp.net/eng/docs/library
But i need to cancel file transferring. Please give your suggestion.
Upvotes: 3
Views: 721
Reputation: 202360
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();
Upvotes: 0
Reputation: 312
To my understanding the only way to achieve this is to abort the current session.
link: https://winscp.net/eng/docs/library_session_abort
Upvotes: 2