I am connecting my website to faceboo开发者_如何学Pythonk using Facebook Graph API.
public string WebResponseGet(HttpWebRequest webRequest)
{
StreamReader responseReader = null;
string responseData = "";
try
{
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
}
catch
{
throw;
}
finally
{
webRequest.GetResponse().GetResponseStream().Close();
responseReader.Close();
responseReader = null;
}
It gives me an excption Webexception unhandled by user The remote server returned an error
Any tips on this? I dont have a lot of programming experience but given this task.. so pls pardon me if its a question which I should be aware of
Thanks SC
Look at the Response property of the WebException you are thrown. That will contain a message from Facebook which (hopefully) explains the issue
精彩评论