Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 27th, 2006, 09:53 PM
Registered User
Join Date: Nov 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Michael Eaton
Default Using WebClient / Calculating transfer rate

Morning Folks,

I've been trying for the last 2 days to figure this one out with no luck.. so here goes..

As you can see in my code pasting below, i have a file thats downloaded in the button1_click event, i count the time between download start and finish, all this works fine.. now im wanting to show the download rate, and for the life of me, i cannot figure out how i can do this.. you'd think there would be some method or something but there isnt, the only way i can figure out the rate is on the timer1_tick event to count the bytes that was download since the last tick, and take that from it.. if that didnt make sense try this:

work out the amount downloaded in each given second, and every second add it to the previous second and take the median of the two as the average, and use the average amount downloaded per second x the number of seconds,

and from that you have an average download speed over the entire download that gets more accurate every second till its finished


I really hope someone can help!




Thanks for all your help P2P Wrox! (and its users)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rate this book? badness BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 4 July 13th, 2007 07:42 PM
Exchange rate msbsam ASP.NET 2.0 Basics 0 January 4th, 2007 03:50 AM
help on using WebClient object siroman .NET Framework 2.0 0 October 20th, 2005 09:28 AM
WebClient.DownloadFile yagiroy VS.NET 2002/2003 0 October 5th, 2003 01:17 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.