JSON Object Help

{
  "accuracy": 0.17,
  "dogr": 108,
  "dogt": 22,
  "elo0": 602.29,
  "elo1": 587.28,
  "games": 305
}

I have these values ​​above from a JSON object,

    JObject general = (JObject)bfbc_array[0]["general"];
    foreach (float generalsNumbers in general.PropertyValues())
    {
        listBox7.Items.Add(generalsNumbers);
    }

This loop iterates through the object, and I can get the number of each one. This is great, but I also want to get the text, and I'm completely at a dead end. What do I need to use so that I can get the text? (I am using JSON.NET)

+3
source share
1 answer

You should be able to run the loop generalas follows:

JObject general = (JObject)bfbc_array[0]["general"];
foreach (var item in general)
{
    Console.WriteLine("{0} : {1}", item.Key, item.Value);
}

If you need type numbers float, you can use them:

float value = (float)item.Value;
+3
source

All Articles