json格式如图

c#获取json数组里指定参数

我要获取items里的positive_prob这个int型的值

    分解json,responseString是如上图格式:
            JObject jsonObj = JObject.Parse(responseString);        

    分解后的jsonObj格式如图

c#获取json数组里指定参数

指定数据为数组        
            JArray item = JArray.Parse(jsonObj["items"].ToString());                           
            string positive = item[0]["positive_prob"].ToString();

成功!

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-10-25
  • 2021-08-19
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-01-27
相关资源
相似解决方案