Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i`m trying to read a facebook wall using Json, but I get the error-
Cannot access child value on Newtonsoft.Json.Linq.JProperty. Any ideas?
C#
string pageInfo = client.DownloadString(string.Format("https://graph.facebook.com/Pokerfreerollpass?access_token={0} ", accessToken));
           string pagePosts = client.DownloadString(string.Format("https://graph.facebook.com/Pokerfreerollpass/posts?access_token={0} ", accessToken));
           //Console.Write(pagePosts);
           var result = JsonConvert.DeserializeObject<dynamic>(pagePosts);
           foreach (var item in result)
           {
               Console.WriteLine(item["body"]["message"].ToString());
           }
Posted
Comments
CHill60 29-May-13 9:34am    
Try foreach(var item in result.Children())
Soloveikok 29-May-13 11:22am    
Nop, still same error
AlphaDeltaTheta 29-May-13 22:43pm    
Go for JObject.Parse() it gives a dynamic object. Store the object in a dynamic

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900