Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
Questionmore than 255 characters (mdb) Pin
likefood3-May-06 12:46
likefood3-May-06 12:46 
AnswerRe: more than 255 characters (mdb) Pin
Guffa3-May-06 12:53
Guffa3-May-06 12:53 
GeneralRe: more than 255 characters (mdb) Pin
likefood3-May-06 13:10
likefood3-May-06 13:10 
QuestionDynamically Create Controls Pin
JoJuPi013-May-06 12:37
JoJuPi013-May-06 12:37 
AnswerRe: Dynamically Create Controls Pin
Ravi Bhavnani3-May-06 12:45
professionalRavi Bhavnani3-May-06 12:45 
GeneralRe: Dynamically Create Controls Pin
MoustafaS3-May-06 12:49
MoustafaS3-May-06 12:49 
AnswerRe: Dynamically Create Controls Pin
MoustafaS3-May-06 12:48
MoustafaS3-May-06 12:48 
QuestionCompute Speed of Download Algorithm Pin
zx2c43-May-06 12:19
zx2c43-May-06 12:19 
Currently, I am working on ZX2C4 Instant Messenger. ( http://zx2c4-im.sf.net ). For file transfers, a connection class raises an event for every 1024 bytes it receives (and finally length%1024 bytes at the end). This event is picked up by a form that has a progress bar.

Everytime the event is called, I make the progress bar's value maximumvalue * (bytes trasfered/total). However, I lack a good way to compute the number of kb/s at which the file is downloading.

Currently, when the progress bar is created, I assign a global varible called "start" to DateTime.Now, and every time the update event is signaled, I make the current speed equal to (bytes transfered) / (DateTime.Now - start).

While this works, it only provides the average speed of the whole download. What is the best way to calculate the current speed of the download?

Jason A. Donenfeld
ZX2C4 Instant Messenger
AnswerRe: Compute Speed of Download Algorithm Pin
Ravi Bhavnani3-May-06 12:48
professionalRavi Bhavnani3-May-06 12:48 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c43-May-06 12:52
zx2c43-May-06 12:52 
GeneralRe: Compute Speed of Download Algorithm Pin
Ravi Bhavnani3-May-06 12:54
professionalRavi Bhavnani3-May-06 12:54 
GeneralRe: Compute Speed of Download Algorithm Pin
zx2c43-May-06 12:58
zx2c43-May-06 12:58 
GeneralRe: Compute Speed of Download Algorithm Pin
Ravi Bhavnani3-May-06 13:03
professionalRavi Bhavnani3-May-06 13:03 
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 
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 

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.