Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c43-May-06 13:06
zx2c43-May-06 13:06 
AnswerRe: Compute Speed of Download Algorithm Pin
Guffa3-May-06 12:58
Guffa3-May-06 12:58 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c43-May-06 12:59
zx2c43-May-06 12:59 
GeneralRe: Compute Speed of Download Algorithm Pin
Guffa3-May-06 21:58
Guffa3-May-06 21:58 
GeneralRe: Compute Speed of Download Algorithm Pin
Phil C5-May-06 20:13
Phil C5-May-06 20:13 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c46-May-06 9:16
zx2c46-May-06 9:16 
GeneralRe: Compute Speed of Download Algorithm Pin
Phil C6-May-06 10:01
Phil C6-May-06 10:01 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c46-May-06 13:30
zx2c46-May-06 13:30 
Thank you so much!

The download speed seems much more sporatic though :'(.
Here's my implementation:

public void UpdateStatus(double percentage)<br />
{<br />
    this.progressBar1.Value = (int)Math.Round(((double)this.progressBar1.Maximum * percentage));<br />
    this.label2.Text = String.Format("Progress: {0}%", Math.Round(percentage * 100.0, 2));<br />
    _movingAverage -= _movingAverage / (double)SAMPLESIZE;<br />
    _movingAverage += (DateTime.Now - _lastSegment).TotalSeconds;<br />
    _lastSegment = DateTime.Now;<br />
    if (_movingAverage > 0)<br />
    {<br />
        this.label1.Text = String.Format("Speed: {0} kb/s", Math.Round(((double)SAMPLESIZE * (double)StreamUtils.FilePacketSize / 1024.0) / _movingAverage, 2));<br />
    }<br />
    else<br />
    {<br />
        this.label1.Text = "Speed: N/A";<br />
    }<br />
}


The download speed is strangly sporatic though...
GeneralRe: Compute Speed of Download Algorithm Pin
Phil C6-May-06 15:32
Phil C6-May-06 15:32 
QuestionFull Text PDF Pin
smarttom993-May-06 11:47
smarttom993-May-06 11:47 
QuestionAdvice on best technologies for video / graphics work Pin
srev3-May-06 11:17
srev3-May-06 11:17 
QuestionHave associated files use currently running instance Pin
ilion blaze3-May-06 10:41
ilion blaze3-May-06 10:41 
AnswerRe: Have associated files use currently running instance Pin
Stefan Troschuetz3-May-06 11:14
Stefan Troschuetz3-May-06 11:14 
GeneralRe: Have associated files use currently running instance Pin
ilion blaze3-May-06 11:19
ilion blaze3-May-06 11:19 
GeneralRe: Have associated files use currently running instance Pin
Phillip M. Hoff3-May-06 19:31
Phillip M. Hoff3-May-06 19:31 
QuestionHow can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
Elvia Gonzalez3-May-06 9:51
Elvia Gonzalez3-May-06 9:51 
AnswerRe: How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
Elvia Gonzalez3-May-06 13:09
Elvia Gonzalez3-May-06 13:09 
GeneralRe: How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
goyal manish3-May-06 21:36
goyal manish3-May-06 21:36 
GeneralRe: How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
Elvia Gonzalez4-May-06 7:29
Elvia Gonzalez4-May-06 7:29 
GeneralRe: How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
Elvia Gonzalez4-May-06 8:13
Elvia Gonzalez4-May-06 8:13 
GeneralRe: How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn? Pin
Elvia Gonzalez4-May-06 14:31
Elvia Gonzalez4-May-06 14:31 
QuestionHow to pass form reference at run time. Pin
abhinish3-May-06 9:32
abhinish3-May-06 9:32 
AnswerRe: changing datagridview cell Pin
Office Lineman3-May-06 12:27
Office Lineman3-May-06 12:27 
QuestionCustom Tooltips Pin
siongc3-May-06 9:15
siongc3-May-06 9:15 
AnswerRe: Custom Tooltips Pin
Ravi Bhavnani3-May-06 9:45
professionalRavi Bhavnani3-May-06 9:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.