-1

i have xml data, and i need download to string this. But c# return error like this "Remote adress return error" , but this site is alive and work on my firefox. How to download this data?

My codes:

 WebClient x = new WebClient();
       string y= x.DownloadString("http://dizilab.com/diziler.xml");
       MessageBox.Show(y); 
Murat KA
  • 137
  • 1
  • 7
  • When do you get the error? On your second line of code where you actually call `x.DownloadString()`? – sab669 Aug 27 '15 at 20:19
  • 1
    The first time I tried to load the file it sent me to a cloudFlare countdown page. What is the exact error? – mjw Aug 27 '15 at 20:20
  • yes this problem is cloudflare, how to access xml data without cloudflare – Murat KA Aug 27 '15 at 20:24
  • 1
    CloudFlare has a timer feature enabled that prevents this site from various attacks... There is no way of getting around this – Philippe Paré Aug 27 '15 at 20:25
  • This can help you. [How to use WebRequest to post data and get response from a webpage][1] [1]: http://stackoverflow.com/questions/1502500/how-to-use-webrequest-to-post-data-and-get-response-from-a-webpage – Lali Aug 27 '15 at 20:40
  • @Lali thanks for answer but its not work :( – Murat KA Aug 27 '15 at 20:47

1 Answers1

0

According to a CloudFlare employee who answered this question: cURL - Load a site with CloudFlare protection

If you own the hosted site, you can whitelist your calling domain to allow access, otherwise you "supposedly" have no way of getting around this protection. However, there is a second answer that offers an option that you may find useful if you're familiar with cURL.

Community
  • 1
  • 1
mjw
  • 1,196
  • 1
  • 12
  • 19
  • No I think you just have to use a user-agent for something like mozilla or ie or some browser, I'm not sure myself but it has worked for other people – Man Person Aug 27 '15 at 20:30