Click here to Skip to main content
15,898,769 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using (var wc = new WebClient())
                      {
                          Uri urls = new Uri(url);
                          wc.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
                          dokuman.Load(wc.OpenRead(urls), Encoding.UTF8);
                      }

dokuman.Load Error The remote server returned an error: (503) Server Unavailable.
Posted
Comments
Member 10665816 21-Apr-14 13:09pm    
Could you explain better what's your problem and what you want to achieve?
In this case, your code (even you getting an error) was the solution for my code.
frs10 30-Mar-20 19:05pm    
Did you find a solution to this? I am having the same issue and the "solution" you were given by Shameel is useless. When I browse to the url with Firefox it opens right up so the server is obviously available but with the webclient it does not. I suspect it is a firewall issue.

1 solution

The error is self-explanatory. It's a server error and you can do nothing much about it from the client code. Check if your url is correct. Paste the url in a browser window and see if you get the same error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900