Why in my WebClient DownloadFileAsync method downloading an Empty File?

前端 未结 4 391
情歌与酒
情歌与酒 2021-01-02 04:51

I have this C# code but the final esi.zip results in 0 length or basically empty. The URL does exist and confirms to download the file manually. I am baffled buy this.

4条回答
  •  一生所求
    2021-01-02 05:39

    Adding this worked very fine for me! Thanks!

    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;
    

提交回复
热议问题