Problem with Cancel download and download speed with single mail

May 14, 2013 at 3:03 PM
Edited Sep 16, 2013 at 7:26 PM
Now my code look like this
start = System.DateTime.Now;
message = pop.RetrieveMessageObject(i,false);
foreach (MimePart attachment in message.Attachments)
{
    size = attachment.Size;
    attachment.StoreToFile(filepatchnow);
    stop = System.DateTime.Now;
        elapsedTime = stop - start;
}

if (elapsedTime.Seconds > 0 && size > 0)
{
       downloadspeed = (double)(size / ((elapsedTime.Minutes * 60) + elapsedTime.Seconds)) / 1024;
}
if (status == "Canceling")
{
Canceling();
}
I have problem with:
  • canceling download (now task is canceling when download attachment is done)
  • download speed (now speed is calculate when download attachment is done. I want refresh download speed in 2-3 seconds)
Do you now how realize this task?

PS. Sorry for my poor english
Sep 16, 2013 at 7:26 PM
Anyone help me with this problems? :)
Dec 2, 2013 at 6:31 PM
I have idea.

How download message.Attachement[x].BinaryContent with 4 KB download buffor?