A
aferriere
Hi
I am getting a System.Net.WebException -- >The remote server returned
an error: (501) Not Implemented
when I try to read the contents from
http://www.ourcommunity.com.au/member/directory_details.do?orgId=319
Other urls which I have tried work fine.
I have tried using both WebRequest and WebClient
*****CODE USING WebRequest*******
string result;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
//*** GetResponse() THROWS THE System.Net.WebException *****
using (StreamReader sr = new
StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
*****CODE USING WebClient*******
WebClient objWebClient = new WebClient();
byte[] aRequestedHTML;
aRequestedHTML = objWebClient.DownloadData(url);
//*** DownloadData() THROWS THE System.Net.WebException ****
UTF8Encoding objUTF8 = new UTF8Encoding();
string strRequestedHTML;
strRequestedHTML = objUTF8.GetString(aRequestedHTML);
result = strRequestedHTML;
Pretty much stuck here and not sure if there is any other way to get
the page content. Anyone knows of how I could bet the content from
http://www.ourcommunity.com.au/member/directory_details.do?orgId=319
Any help would be greatly appreciated
I am getting a System.Net.WebException -- >The remote server returned
an error: (501) Not Implemented
when I try to read the contents from
http://www.ourcommunity.com.au/member/directory_details.do?orgId=319
Other urls which I have tried work fine.
I have tried using both WebRequest and WebClient
*****CODE USING WebRequest*******
string result;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
//*** GetResponse() THROWS THE System.Net.WebException *****
using (StreamReader sr = new
StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
*****CODE USING WebClient*******
WebClient objWebClient = new WebClient();
byte[] aRequestedHTML;
aRequestedHTML = objWebClient.DownloadData(url);
//*** DownloadData() THROWS THE System.Net.WebException ****
UTF8Encoding objUTF8 = new UTF8Encoding();
string strRequestedHTML;
strRequestedHTML = objUTF8.GetString(aRequestedHTML);
result = strRequestedHTML;
Pretty much stuck here and not sure if there is any other way to get
the page content. Anyone knows of how I could bet the content from
http://www.ourcommunity.com.au/member/directory_details.do?orgId=319
Any help would be greatly appreciated