Home Forums .NET libraries Xceed SFTP/FTP for .NET Time Remaining please help me!

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #21323 |

    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)

    TrayIcon_.Text =

    “Downloading: “ + ListBox1.SelectedItem + ” @ “ + a.BytesPerSecond.ToString

    txtSpeed.Text = a.BytesPerSecond.ToString

    If txtSpeed.Text > 1024 Then

    lblSpeedUnit.Text =


    txtSpeed.Text = txtSpeed.Text / 1024

    End If

    Downloaded_.Text = a.BytesTransferred.ToString +

    ” / “ + a.BytesTotal.ToString + ” bytes”

    ProgressBar1.Value = a.BytesPercent

    lblProgress.Text = a.BytesPercent.ToString +


    If a.BytesPercent = 100 Then

    TrayIcon_.BalloonTipIcon =


    TrayIcon_.BalloonTipText =

    “Finished download of “ + ListBox1.SelectedItem



    “Download of “ + ListBox1.SelectedItem + “is completed”)

    End If

    End Sub

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by home (had 1727 views)

    Diane [Xceed]
    Post count: 1353


    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.