I am using the code below to download file.
WebClient myWebClient = new WebClient();
myWebClient.DownloadFile(myStringWebResource, fileName);
But suddenly I have started to get 504 error. After adding header, the error has gone.
myWebClient.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0)" +
" (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
2 comments:
you saved my day. Thanks alot.
It's save my entire day.Thanks
Post a Comment