Pause/Resume Upload in C#

前端 未结 4 1801
我在风中等你
我在风中等你 2021-01-14 07:00

I\'m looking for a way to pause or resume an upload process via C#\'s WebClient.

pseudocode:

WebClient Client = new WebClient();
Client.UploadFileAsync(new         


        
4条回答
  •  无人及你
    2021-01-14 07:20

    To do something like this you must write your own worker thread that does the actual http post stepwise.

    Before sending a you have to check if the operation is paused and stop sending file content until it is resumed.

    However depending on the server the connection can be closed if it isn't active for certain period of time and this can be just couple of seconds.

提交回复
热议问题