Here is the downloading time when I click update button:
- First time = 5 sec
- After first time = 2 sec
Why it takes more time at first time? Without wc.Proxy = null;
it took 2 minute at first time, is there anything else that slow it down?
Stopwatch sw = new Stopwatch();
sw.Start();
using (WebClient wc = new WebClient())
{
wc.Proxy = null;
wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0");
wc.DownloadFile("http://example.com/folder/file.txt",@"folder/files/file.txt");
}
sw.Stop();