简体   繁体   English

如何使用Facebook SDK C#在listView中加载组

[英]how to load groups in listView using Facebook SDK C#

I am using Facebook SDK c# to make windows application. 我正在使用Facebook SDK c#制作Windows应用程序。 I try to load all page which I like it is successful. 我尝试加载所有我认为成功的页面。

The problem is when I press the load page button it load this data 1 more to become have duplicate, and get every page I like it 2 times my code 问题是,当我按下加载页面按钮时,它又将该数据加载1个成为重复数据,并获得我喜欢的每个页面2倍的代码

    private void button2_Click(object sender, EventArgs e)
    {
        string[,] friends;
        FacebookClient fb = new FacebookClient(AppSettings.Default.AccessToken);
        dynamic Grouplist = fb.Get("/me/likes");
        int count = (int)Grouplist.data.Count;
        friends = new string[count, 1];
        for (int i = 0; i < count; i++)
        {
            listView3.Items.Add(Grouplist.data[i].name);
        }
    }


listView3.Items.Clear();
for (int i = 0; i < count; i++)
{
    listView3.Items.Add(Grouplist.data[i].name);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM