Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:16:14+00:00 2026-06-04T12:16:14+00:00

I’m trying to parse json data from the facebook c# sdk. The json data

  • 0

I’m trying to parse json data from the facebook c# sdk. The json data I’m trying to parse can be seen here at facebook: https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000&access_token=AAAAAAITEghMBACQupPhpGCGi1Jce7eMfZCzt9GlpZBdhz3PlGCyHKNZB1r4FHgd9mgpm8W3g4Adpy9jJjFrsDuxcu3pE4uRT1lbIQjYKgZDZD

My code below will pop up a message box showing the first dimension of this json object, however, as you can see, there is a second dimension within each item which gives location information such as longitude and latitude. I’m struggling to find an example as to how one would get this with WP7 C# (most examples on the internet use libraries that aren’t usable on WP7).

        fbClient.GetCompleted += (o, er) =>
        {
           if (er.Error == null)
           {
              var result = (IDictionary<string, object>)er.GetResultData();
              Dispatcher.BeginInvoke(() =>
              {
                  foreach (var item in (JsonArray)result["data"])
                  {
                     //message box for testing purposes
                     MessageBox.Show((string)((JsonObject)item)["name"]);
                  }
              });
           }
        });

Would someone be able to provide a quick example?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:16:16+00:00Added an answer on June 4, 2026 at 12:16 pm

    Because you use with FacebookSDK it’s not neccecary work with json directly.
    Just cast JsonObjects to IDictionary and work with it like Dictionary:

    //think better use IEnumerable<object>, because you don't really need JSON array
        foreach (var item in (IEnumerable<object>)result["data"])
                          {
                             var name = (item as IDictionary<string, object>)["name"];
                             //message box for testing purposes
                             MessageBox.Show(name);
                          }
    

    So, you can work with JsonArray like IEnumerable<object> and with JsonObject like IDictionary<string, object>

    Answer for you question:

    var item1 = (IDictionary<string, object>)item;
    var location = ((IDictionary<string, object>)(item1)["location"]);
    var long = location["longitude"];
    

    Or you can do it using JSON:

    var location = ((JsonObject)((JsonObject)item)["location"]);
    var long = location["longitude"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.