This project has moved. For the latest updates, please go here.

TftpOnProgress event with percentage

Apr 22, 2014 at 9:21 AM
Is there any chance to get the percentage of a transfer in the event TftpOnProgress instead of bytes. In my case I use the library to implement a download server?
Jun 16, 2014 at 6:02 AM
Yes, no Problem. I just uploaded an update to the library. Check the ITftpTransfer.OnProgress - Event. It includes everything necessary to calculate the percentage. The SampleClient demo application also shows how it's done:
var client = new TftpClient("");
var transfer = client.Receive("Testfile.txt");
transfer.OnProgress += new TftpProgressHandler(transfer_OnProgress);

static void transfer_OnProgress(ITftpTransfer transfer, TftpTransferProgress progress)
  if (progress.TotalBytes > 0)
    Console.WriteLine((progress.TransferredBytes * 100) / TotalBytes + "% completed");
    Console.WriteLine(progress.TransferredBytes + "Bytes received");
Jul 2, 2014 at 8:52 AM
Thanks man,
I will include new options on my project.