|
Our company has purchased the SFTP and SSL product. I am using C# console apps to download files. Is there a code snippet anywhere that will show me how to display kbs/sec and % downloaded for the current file? |
|
Hello. 1) Getting transfer rate [kbs/sec] Since Rebex (S)Ftp component 2010-03-11 Version 3.0.3723 the transfer rate can be obtained by setting TransferProgress event as follows:
2) Getting % of downloaded size This can be solved similarly as previous question. There is no direct support for download/upload percentage but you can calculate this by exploiting the TransferProgess event as in the previous case. It containts e.BytesTransferred property. For percentage evaluation you need the total size of the file. The remote file size (in case of GetFile) can be obtained by ftp.GetFileLength(...); the size of the local file (in case of PutFile) by FileInfo info = new FileInfo(...); info.Length. |