How can i get the information of FileTransfer Progress on SCP ??

Mar 27, 2013 at 2:10 AM
Hello~

Im using the SCP Class in some my programs.

It is very useful. But I can NOT know how transfer the upload file to a server.

May Anyone use the Filetransfer Progress??
Coordinator
Mar 27, 2013 at 5:32 PM
Hi,

Here is a code example that I used ion my test:
            using (var scp = new ScpClient(connectionInfo))
            {
                scp.Connect();
                scp.BufferSize = 1024;
                scp.Downloading += delegate(object sender, ScpDownloadEventArgs e)
                {
                    Console.WriteLine(e.Filename + ":" + e.Size + ":" + e.Downloaded);
                };

                scp.Uploading += delegate(object sender, ScpUploadEventArgs e)
                {
                    Console.WriteLine(e.Filename + ":" + e.Size + ":" + e.Uploaded);
                };
Unfortunately I recently just found a bug that Uploading does not count it correctly so will try to fix it later.

Hope it helps,
Thanks,
Oleg
Mar 29, 2013 at 8:26 AM
oh.. Thanks Oleg!!

I will try your solutions. And feedback the result to you.

Thanks!