0

I am trying to give custom timeout to WebClient() object. I have tried lots of solutions including this post and this post and lots of others. The conclusion I came up with is setting a custom timeout is not working for WebClient() object when you use DownloadFileAsync() or DownloadStringAsync(). (There are other people saying this too in these posts)

Are there any other solutions that I couldn't see or find on the internet?

Community
  • 1
  • 1
Zapdos
  • 617
  • 1
  • 6
  • 23
  • maybe you are doing it wrong include some code – Masoud Andalibi Dec 30 '16 at 17:06
  • Why u didn`t want use HttpClient? – Danny Dec 30 '16 at 17:23
  • @Valkyriee Nope, I am not doing it wrong. Look at the links I provided. There are replies and comments about setting custom timeout is not working with WebClient. – Zapdos Dec 30 '16 at 17:48
  • @Danny I wanted to use it but it does not support upload/download progress. There is a package which brings this functionality to HttpClient but I don't want to use it. Link: https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Client – Zapdos Dec 30 '16 at 17:50
  • @Zapdos check it, https://github.com/dotnet/corefx/issues/6849 – Danny Dec 30 '16 at 18:00
  • Thank you but this code is for downloading. I managed to have a progress bar similar to this solution for downloading, I forgot to mention it. I can provide a code for it. But uploading is a different issue and cannot get a progress report for it. – Zapdos Dec 30 '16 at 18:05

0 Answers0