Pause / resume loading in C #

I am looking for a way to pause or resume the download process through C # WebClient.

pseudo code:

WebClient Client = new WebClient ();
Client.UploadFileAsync (new Uri ("http://mysite.com/receiver.php"), "POST", "C: \ MyFile.jpg");

Maybe something like ..

Client.Pause ();

any idea?

+3
source share
4 answers

WebClient - HttpWebRequest, , . HTTP, , - (, , ). WebClient API .

+6

, Webclient not HttpWebRequest.

, , ; , WebClient , , . Pause/resume.

, API, , , . -, .

+3

ok, . , .

WCF , .

, :

  • , , , .
  • , . ( , , , , ).
  • , , . , , , .
  • , , - URL-. ssl, , .
  • .

, , .

, , , .

+2
source

To do something like this, you have to write your own workflow that makes the actual HTTP mail step by step.

Before sending, you need to check whether the operation is paused and stop sending the contents of the file before it resumes.

However, depending on the server, the connection may be closed if it is inactive for a certain period of time, and this may be only a few seconds.

0
source

Source: https://habr.com/ru/post/1711332/


All Articles