Home › Forums › .NET libraries › Xceed SFTP/FTP for .NET › Time Remaining please help me!
hi im still making the project as u saw b4 in my older posts so i got it to show many stuff and im almost done
So what i really need to know is how to make it show the time remaining for the file that is downloading im using visual basic 2010 so if you can show me a code example that should do it
My code example this might give an idea or help of what i need:
i got this is just an example to give and idea
client.SynchronizingObject = txtspeed
client.SynchronizingObject = Downloaded_
client.SynchronizingObject = ProgressBar1
Private Sub OnFileTransferStatus(ByVal sender As Object, ByVal a As FileTransferStatusEventArgs)
“Downloading: “ + ListBox1.SelectedItem + ” @ “ + a.BytesPerSecond.ToString
txtSpeed.Text = a.BytesPerSecond.ToString
If txtSpeed.Text > 1024 Then
txtSpeed.Text = txtSpeed.Text / 1024
Downloaded_.Text = a.BytesTransferred.ToString +
” / “ + a.BytesTotal.ToString + ” bytes”
ProgressBar1.Value = a.BytesPercent
lblProgress.Text = a.BytesPercent.ToString +
If a.BytesPercent = 100 Then
“Finished download of “ + ListBox1.SelectedItem
“Download of “ + ListBox1.SelectedItem + “is completed”)
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by home (had 1727 views)
There is nothing in FTP .NET to give you an easy way to calculate the transfer time remaining. The algorithms to calculate that aren’t trivial.
However, if your subscribe to the byte progression events, you will be given information on the amount of bytes transferred and the total number of bytes for the file, if available.
You would need to write an algorithm that tracks the amount of time between calls to the event handler, and make an estimate of the time remaining based on that information.
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 1437 views)