How do I enumerate through a JObject?

前端 未结 4 2135
暗喜
暗喜 2020-11-28 05:52

I\'m trying to determine how to access the data that is in my JObject and I can\'t for the life of me determine how to use it.

JObject Object = (JObject)Resp         


        
4条回答
  •  醉梦人生
    2020-11-28 06:23

    The answer did not work for me. I dont know how it got so many votes. Though it helped in pointing me in a direction.

    This is the answer that worked for me:

    foreach (var x in jobj)
    {
        var key = ((JProperty) (x)).Name;
        var jvalue = ((JProperty)(x)).Value ;
    }
    

提交回复
热议问题