Changing the progress reporting interval of FTP and SFTP clients

The static ProgressReportInterval property of the FileSystem class introduced in v5.2 can help you reduce the number of calls to your Progress event handlers. As a result it can make you program run faster. To disable the Progress reporting timing, you can set the ProgressReportInterval property to 0 (zero) meaning the Progress event is raised whenever there is data transferred while uploading or downloading files. The default value is 100 ms. The following example shows you how to set that property:

// Create a new instance.
Sftp client = new Sftp();
// Connect to the SFTP server.
// Authenticate.
client.Authenticate("username", "password");
// ...
// Set the progress report interval
ComponentPro.IO.FileSystem.ProgressReportInterval = 500; // Fire the Progress event every 500ms
// Upload all files and subdirectories from local folder 'c:\temp' to the remote dir '/temp'
client.UploadFiles("c:\\temp", "/temp");
// ...
// Disconnect.

45-Day Money Back Guarantee

We will refund your full money in 45 days
if you are not satisfied with our products

Buy Now

Dont miss out Get update on new articles and other opportunities