0

我正在使用带有 VB 的 facebook-c#-sdk。

我的代码:

dim facebook As New FacebookApp()

dim queries as string=" ""2011-4-13"" : ""SELECT metric, value FROM insights WHERE object_id=173249789387842 AND metric='page_active_users' AND end_time=end_time_date('2011-4-13') AND period=period('day')"",""2011-4-14"" : ""SELECT metric, value FROM insights WHERE object_id=173249789387842 AND metric='page_active_users' AND end_time=end_time_date('2011-4-14') AND period=period('day')"""

dim oFQLResult As Object = facebook.Query(queries )

我得到: Facebook.FacebookApiException:解析器错误:位置 0 处出现意外“\”。

单个查询完美。进行多查询的正确方法是什么?

谢谢!

4

1 回答 1

2

您可能想查看这些 nuget 包。(示例在 C# 中)

Install-Package Facebook.Sample
Install-Package Facebook.Sample.Dynamic

这是 C# 中的示例。

        var query1 = "SELECT uid FROM user WHERE uid=me()";
        var query2 = "SELECT profile_url FROM user WHERE uid=me()";

        try
        {
            var fb = new FacebookClient(accessToken);

            var result = (IList<object>)fb.Query(query1, query2);

            var result0 = ((IDictionary<string, object>)result[0])["fql_result_set"];
            var result1 = ((IDictionary<string, object>)result[1])["fql_result_set"];
        }
        catch (FacebookApiException ex)
        {
            // Note: make sure to handle this exception.
            throw;
        }
于 2011-04-28T07:02:36.310 回答