Alex K. :
Looking in Fiddler the request fails if there is not a legitimate U/A string, so:\n\nWebClient wb = new WebClient();\nwb.Headers.Add(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.33 Safari/537.36\");\nwb.DownloadFile(\"http://www.cryptopro.ru/products/cades/plugin/get_2_0/cadeplugin.exe\", \"c:\\\\xxx\\\\xxx.exe\");\n",
2015-09-22T14:04:44
Slashy :
I belive this would do the trick.\n\nWebClient wb = new WebClient();\nwb.DownloadFile(\"http://www.cryptopro.ru/products/cades/plugin/get_2_0/cadeplugin.exe\",\"file.exe\");\n",
2015-09-22T13:42:37
Kreshnik :
If you need to know the download status or use credentials in order to make the request, I'll suggest this solution: \n\nWebClient client = new WebClient();\nUri ur = new Uri(\"http://remoteserver.do/images/img.jpg\");\nclient.Credentials = new NetworkCredential(\"username\", \"password\");\nclient.DownloadProgressChanged += WebClientDownloadProgressChanged;\nclient.DownloadDataCompleted += WebClientDownloadCompleted;\nclient.DownloadFileAsync(ur, @\"C:\\path\\newImage.jpg\");\n\n\nAnd her it is the implementation of the callbacks:\n\nvoid WebClientDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)\n{\n Console.WriteLine(\"Download status: {0}%.\", e.ProgressPercentage);\n}\n\nvoid WebClientDownloadCompleted(object sender, DownloadDataCompletedEventArgs e)\n{\n Console.WriteLine(\"Download finished!\");\n}\n",
2016-07-07T16:19:36
DPac :
Try WebClient.DownloadData\n\nYou would get response in the form of byte[] then you can do whatever you want with that.",
2015-09-22T13:42:47