-3

through this code I try to read the values ​​of summary-> unseen_count but I can not

FacebookClient fb = new FacebookClient(Settings.Default["token"].ToString());

        try
        {
            dynamic FriendList = fb.Get("/me/notifications");

            int count = (int)FriendList.data.Count;

            for (int i = 0; i < count; i++)
            {
                textBox1.Text = FriendList.data[i].summary.unseen_count;
            }
        }
        catch
        {

        }

return the json data:

{
       "data": [
          {
             "id": "notif_1000XXXX",    
              "etc"...         
          }
       ],
       "paging": {},

       "summary": {
          "unseen_count": 2,
          "updated_time": "2013-05-22T18:39:00+0000"
       }
    }

Can you help me please? I never understood how it works json

Federal09
  • 639
  • 4
  • 9
  • 25

1 Answers1

2

It looks like summary is not a child of data; have you tried the following (outside of the for loop)?

textBox1.Text = FriendList.summary.unseen_count;
wgraham
  • 1,383
  • 10
  • 16