Facebook将Asp.Net使用哪个SDK [英] Which SDK to use for Asp.Net with Facebook

查看:49
本文介绍了Facebook将Asp.Net使用哪个SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Facebook canvas Flash应用程序,并且我的服务器位于Asp.Net 2.0中.我检查了Facebook开发人员Wiki,似乎有不同的Asp.Net SDK 可用.请建议我哪个是最好的.

I am working on a Facebook canvas flash app and my server is in Asp.Net 2.0. I checked the facebook developer wiki and it seems like there are different Asp.Net SDKs available. Please suggest me which is the best one.

推荐答案

您可以像这样通过后面的代码通过url调用Facebook api函数

You can call Facebook api function through url in code behind like this

 string url = "https://graph.facebook.com/" + userId + "/friends?access_token=" +oAuthToken;  

 string results = string.Empty;

 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
 HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

 StreamReader sr = new StreamReader(resp.GetResponseStream());
 results = sr.ReadToEnd();
 sr.Close();

结果"将采用Json对象的形式,您可以对其进行解析以获取数据.上面的示例将为您提供带有"access_token"的指定"userid"的朋友的详细信息.

"result" will be in the form of Json object, you can parse it to get the data. Above example will get you details of friends of the specified "userid" with "access_token".

这篇关于Facebook将Asp.Net使用哪个SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆