DownloadFileAsync Thread Issues

G

Guest

Hi All,



Trying to encapsulate the WebClient class and DwonloadFileAsync method
in a separate class/assembly (business object), so that I can download and
keep track of multiple downloading files. Is there any way to marshall the
data (progress, completed) info, back to a WinForms assuring that my WinForm
controls will be updated on the thread upon which they are created as to
avoid CrossThreading issues. I have been beating my head for 4 days and
tried almost everything under sun, but to no avail. I'd like to specify an
indicator control per class instance so that each file's progress indicator
is updated accordingly and safely. I also tried using the BackgroundWorker,
but I thought that since DownloadFileAsync already runs on another thread, it
would be overkill. I just need to know how to marshall info of the
DownloadFileAsync method (in a separate assembly), back to the UI thread of a
WinForms application while specifying an indicator control to update
(progrssbar, etc...)



Regards,

Giovanni
 
W

William Stacey [MVP]

TMK, there is only a completed event, not a progress event.

--
William Stacey [MVP]

| Hi All,
|
| Trying to encapsulate the WebClient class and DwonloadFileAsync method
| in a separate class/assembly (business object), so that I can download and
| keep track of multiple downloading files. Is there any way to marshall
the
| data (progress, completed) info, back to a WinForms assuring that my
WinForm
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top