client.get(“me/statuses”)返回空;“数据”;使用C#Facebook SDK 5.0.3的阵列

client.get(“me/statuses”)返回空;“数据”;使用C#Facebook SDK 5.0.3的阵列,c#,asp.net,facebook-graph-api,facebook-c#-sdk,C#,Asp.net,Facebook Graph Api,Facebook C# Sdk,使用C#FacebookSDK5.0.3,在client.Get(“/me”)上一切正常 但是在检索状态时,我应该根据facebook Graph API获取包含所有状态消息的aan arraylist“data”,但是我的数据数组是空的,我得到了一个“Index out-bounds”异常 有人知道我的问题是什么吗 if (Request.Params["code"] != null) { var client = new Facebo

使用C#FacebookSDK5.0.3,在client.Get(“/me”)上一切正常

但是在检索状态时,我应该根据facebook Graph API获取包含所有状态消息的aan arraylist“data”,但是我的数据数组是空的,我得到了一个“Index out-bounds”异常

有人知道我的问题是什么吗

if (Request.Params["code"] != null)
            {

                var client = new FacebookClient(GetAccessToken());

                dynamic me = client.Get("/me");

                imgUser.ImageUrl = "https://graph.facebook.com/" + me.id + "/picture";
                lblUsername.Text = me.name;
                lblHometown.Text = me.hometown.name;
                lblBirthday.Text = me.birthday;
                lblCurrenttown.Text = me.location.name;
                lblEmail.Text = me.email;
                lblOpleidingen.Text = "";
                lblOpleidingen.Text += me.education[1].type + ": " + me.education[1].school.name + ", " + me.education[1].year.name + "<br />"
                    + me.education[0].type + ": " + me.education[0].school.name + ", " + me.education[0].year.name;
                lblSex.Text = me.gender;

                dynamic status = client.get("/me/statuses");

                txtStatus.Text = status.data[0].message;
            }
if(Request.Params[“code”]!=null)
{
var client=newfacebookclient(GetAccessToken());
dynamic me=client.Get(“/me”);
imgUser.ImageUrl=”https://graph.facebook.com/“+me.id+”/picture”;
lblUsername.Text=me.name;
lblHometown.Text=me.homely.name;
lblBirthday.Text=me.birthday;
lblCurrenttown.Text=me.location.name;
lblEmail.Text=me.email;
lblOpleidingen.Text=“”;
lblOpleidingen.Text+=me.education[1]。类型+”:“+me.education[1]。school.name+”,“+me.education[1]。year.name+”
” +me.education[0]。类型+“:”+me.education[0]。school.name+“,“+me.education[0]。year.name; lblSex.Text=me.gender; 动态状态=client.get(“/me/statuses”); txtStatus.Text=status.data[0]。消息; }
它需要读取流权限。确保你拥有它

您的权限数组应如下所示:

string[] extendedPermissions = new[] { "user_about_me", "read_stream" };

            if (extendedPermissions != null && extendedPermissions.Length > 0)
            {
                var scope = new StringBuilder();
                scope.Append(string.Join(",", extendedPermissions));
                parameters["scope"] = scope.ToString();
            }
此外,第二个get()应该大写:get()


前导斜杠是不必要的。你没有试过吗?你从哪里弄来的通行证?我想杰克诺娃是对的。您可能忘记使用在验证时添加的正确权限范围。
dynamic status = client.get("/me/statuses");

dynamic status = client.Get("/me/statuses");