locked
Controlling mutliple downloads RRS feed

  • Question

  • Hello,

    When I use My.Computer.Network.DownloadFile this will sometimes start downloading two copies of the file simultaneously. I wonder if there is a code to check whether there are more than one file being download at a moment, and if there is a code to cancel some of the downloads.

    Thanks,

     

    Wednesday, November 30, 2011 8:53 PM

Answers

  • Hi Hd86,

    Welcome to the MSDN Forum.

    >> I wonder if there is a code to check whether there are more than one file being download at a moment

    Generally, the method DownloadFile only download one file one time. If it downloads duplicate copies, I suggest you try to check your code again to make sure you don't call it twice.

    >>there is a code to cancel some of the downloads.

    As far as I know, there is no such method to cancel the downloading process. But, you can set the showUI parameter to True and onUserCancel to True, so the user can cancel a downloading process.

    In addition, you can try to download a file use this method: DownloadFileAsync ,and then you can cancel it by this method: CancelAsync

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, December 2, 2011 10:38 AM
    Moderator