I'm trying to test another application by requesting many file downloads.
So, I started 10 WebClient instances with following code, but seems I can have just 5 running at same time.
class Program
{
public static object locker = new object();
public static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
...
I got a WPF application and I want to download a file.
I'm using System.Net; and I have the following code:
WebClient ww = new WebClient();
ww.DownloadFileAsync(
new Uri("http://www.sinvise.net/tester/1.jpg"),
AppDomain.CurrentDomain.BaseDirectory + "\\1.jpg");
The problem is, is that it doesn't download the file, it's just ...
I'm using the DownloadFileAsync method of WebClient to download some files from a server, and I can't help but notice that in my informal testing of my code within VS2010, it blocks for about 3 seconds while it starts, which, in my opinion kind of defeats the purpose in the first place.
Here is the relevant snippet of code:
WebClient ...
Is there a recommended method for using DownloadFileAsyc and determining if the file exists? It seems that the only way I can tell is on the DownloadCompleted event the error property has a 404 error in it, and the there's a file created that is 0 bytes.
It would be nice to have a more deterministic method.
...