-
October 7th, 2010, 09:50 AM
#1
System.Net.WebException
Hey all,
I'm making a program that grabs the source code of a given web page. The following is the Method in question:
public string getPageSource(string URL){
try
{
System.Net.WebClient webClient = new System.Net.WebClient();
string strSource = webClient.DownloadString(URL);
webClient.Dispose();
return strSource;
}
catch (Exception ex)
{
return ex.ToString();
}
}
It works for some web pages, although for others it returns:
"WebException: Too many automatic redirections were attempted."
How do I go about fixing this, if I can? Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|