gpt4 book ai didi

facebook-c#-sdk - 使用 facebook c# sdk v6.0.10 执行 FQL 查询

转载 作者:行者123 更新时间:2023-12-03 13:18:57 25 4
gpt4 key购买 nike

我想执行 FQL 来检索所有应用程序用户的 friend 。

在以前版本的 sdk 中,可以通过以下方式完成:

var client = new FacebookWebClient();
client.Query(String.Format("SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = {0})", me.id));

但是对于 6.0.10 版本,我不知道我该怎么做。

有任何想法吗?

最佳答案

FQL

var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql",
new { q = "SELECT uid FROM user WHERE uid=me()" });

FQL 多查询
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql", new
{
q = new[]
{
"SELECT uid from user where uid=me()",
"SELECT name FROM user WHERE uid=me()"
}
});

FQL 命名多查询
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql",
new
{
q = new
{
id = "SELECT uid from user where uid=me()",
name = "SELECT name FROM user WHERE uid " +
"IN (SELECT uid FROM #id)",
}
});

关于facebook-c#-sdk - 使用 facebook c# sdk v6.0.10 执行 FQL 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9771478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com