C#中的多查询格式(不使用C#SDK)

时间:2012-07-02 19:11:58

标签: c# facebook facebook-fql

我试图弄清楚如何在C#中格式化多查询查询字符串但我不能使用C#SDK。到目前为止,这是我尝试过的。

string url = "https://graph.facebook.com/method/fql?q={'q1':'SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND page_id IN (SELECT page_id FROM page WHERE 'MyPage' in name)','q2':'select page_id, name, page_url, pic_small, pic_big from page where page_id in (SELECT page_id FROM #q1)','q3':'SELECT uid, name, pic_small FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() AND (uid2 IN (SELECT uid FROM #q1)))'}&access_token=myaccesstoken&format=json"

string url = "https://graph.facebook.com/method/fql.multiquery?queries={'q1':'SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND page_id IN (SELECT page_id FROM page WHERE 'MyPage' in name)','q2':'select page_id, name, page_url, pic_small, pic_big from page where page_id in (SELECT page_id FROM #q1)','q3':'SELECT uid, name, pic_small FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() AND (uid2 IN (SELECT uid FROM #q1)))'}&access_token=myaccesstoken&format=json"

他们都没有工作。有人可以帮忙吗?

WebClient clientUser = new WebClient();
string JsonResult = clientUser.DownloadString(url);
JObject jsonUserInfo = null;
if (!String.IsNullOrEmpty(JsonResult)) jsonUserInfo = JObject.Parse(JsonResult);

1 个答案:

答案 0 :(得分:0)

您需要转义单引号,例如包装MyPage字符串文字。