Just add a simple line before you make your download:
string url = ...
string fileName = ...
WebClient wb = new WebClient();
wb.Headers.Add("User-Agent: Other"); //that is the simple line!
wb.DownloadFile(url, fileName);
That’s it.
More Related Contents:
- How to post data to specific URL using WebClient in C#
- Deciding between HttpClient and WebClient
- Login to website, via C#
- Authenticate and request a user’s timeline with Twitter API 1.1 oAuth
- How to change the timeout on a .NET WebClient object
- Set timeout for webClient.DownloadFile()
- Upload and download a file to/from FTP server in C#/.NET
- Using CookieContainer with WebClient class
- How to get a JSON string from URL?
- POSTing JSON to URL via WebClient in C#
- C# WebClient disable cache
- Uncompressing gzip response from WebClient
- Kanji characters from WebClient html different from actual Kanji in website
- What difference is there between WebClient and HTTPWebRequest classes in .NET?
- How to check if System.Net.WebClient.DownloadData is downloading a binary file?
- How can you add a Certificate to WebClient (C#)?
- Using WebClient or WebRequest to login to a website and access data
- The notorious yet unaswered issue of downloading a file when windows security is required
- How do I create a directory on FTP server using C#?
- How to ignore a certificate error with c# 2.0 WebClient – without the certificate
- How to fill forms and submit with Webclient in C#
- C# – How to make a HTTP call
- JsonConvert.DeserializeObject (string) returns null value for $id property
- Uploading files to file server using webclient class
- WebClient accessing page with credentials
- How do I authenticate a WebClient request?
- How to get status code from webclient?
- Get Content-Disposition parameters
- How do I Async download multiple files using webclient, but one at a time?
- “A connection attempt failed because the connected party did not properly respond after a period of time” using WebClient