networking - Get Download and Upload Speeds C# -


I'm seeing a class or a library or something that will allow me to get current download speeds, / P>

Anything can provide some sort of code to give this simple functionality.

Thank you very much

I think you want KB / sec It is determined by taking collised and dividing it by the initial seconds by reducing the current seconds. I'm not sure how to do this time in C #, but in VC ++ it will be:

  COleDateTimeSpan dlElapsed = COleDateTime :: GetCurrentTime () - dlStart; Secs = dlElapsed.GetTotalSeconds ();  

You split again:

  double KBSEC = kbreceived / secs; To get  collised  to get   

, you will need to read currentBytes , add already read bytes, then 1024 Divide by. P>

Therefore,

  // Chuck size 512 .. As long as you can max (int bytesread = file-> gt; read (charBuf, 512) )) {Currentbytes = currentbytes + bytesread; // Set the status of progress by setting the current bytes to pause} int percent = current bytes * 100 / x (the size of our file at the top); Int kbreceived = Current bytes / 1024;  

The specific functions of some implementations are identical regardless of the original concept language.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -