0

using the URL http://myanimelist.net/malappinfo.php?u=fakemudkipper&status=all&type=anime And using the code

WebRequest req = WebRequest.Create("http://myanimelist.net/malappinfo.php?u=" + username + "&status=all&type=anime");
WebResponse responce = req.GetResponse();

This code used to work, but suddenly it no longer works, and returns the error The remote server returned an error: (403) Forbidden. It does load on my web browser. I have also tried to use

req.Credentials= new NetworkCredential("username", "password");

But this did not help

Froodle
  • 339
  • 2
  • 5
  • 15
  • It works on my computer. You may got blocked by that site. – L.B Dec 03 '13 at 21:43
  • Odd, i just tried it 1 minute ago and it worked, however it does not work now, Is this a server side problem or still local? – Froodle Dec 03 '13 at 21:47
  • Link works for me. Probably the server had problems, rebooted and you got caught in the middle. Might just be a bad server. – crthompson Dec 03 '13 at 21:59
  • Odd that is works 5% of time in c# and 100% of time in a web browser though – Froodle Dec 03 '13 at 22:16

1 Answers1

1

I suggest looking into Webclient

http://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx

From there you could download the website easier, instead of using webrequests(which already proved bad).

Dean
  • 17
  • 8
  • I have tried downloading it with other methods with things such as WebClient.Downloadhtml /string but with no success i have also tried running this on a different machine and IP but get the same error a % of the time – Froodle Dec 04 '13 at 00:00
  • In last resort, use a webbrowser(object) to navigate(method) there, and on document complete(event), download(method) the document and do what you with with it. – Dean Dec 04 '13 at 01:16