Question

I`m trying to download string from address "http://www.last.fm/music/Boney%20M./+images",but return null,

WebClient webClient = new WebClient();
string html = webClient.DownloadString(new Uri("http://www.last.fm/music/Boney%20M./+images"));
Was it helpful?

Solution

Just tried it on a test application under VS2012 Express, and it's working as intended.

Some thoughts:

  • The problem may lie in the fact that you are behind a proxy, and you may need to create a WebProxy object and provide your credentials.
  • Sometimes (which is not the case, since it worked for me) sites expect some headers - for example HTTP_REFERER.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top