脸书Oauth2.0
我正在使用 Facebook Graph API 将我的网站连接到 Facebook。
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;
}
它给了我一个用户未处理的 WebException 异常 远程服务器返回错误
对此有什么提示吗? 我没有很多编程经验,但考虑到这个任务..所以如果这是一个我应该注意的问题,请原谅我
谢谢 SC
I am connecting my website to facebook 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看抛出的 WebException 的 Response 属性。其中将包含一条来自 Facebook 的消息(希望)能够解释该问题
Look at the Response property of the WebException you are thrown. That will contain a message from Facebook which (hopefully) explains the issue