Reputation: 1441
I am working on windows Application (c#) in Dot.Net. I need to download files from a specific location(for ex, can be from a webapplication which is deplyed in differnt server) through programatically. I have 2 options to achieve this. 1. Using Web Client to download the file. 2. Using BackGround worker thread to download the file.
Please let me know the best way to download the file in c# thro programatically. Also, let me know if any other way is possible to achieve this functionality.
Thanks in Advance
Upvotes: 0
Views: 768
Reputation: 60714
I would go with a BackgroundWorker
here, because of it's nice progress reporting, and it also fires a event when the worker is completed, in your case that is when the download is complete. Both of these events should be easily handleable from your GUI thread.
Upvotes: 2