c# Newtonsoft 遍历 JArray 嵌套Json数组

 时间:2024-10-17 23:02:33

1、首先,网页在线校验一下前端封装得JSON 数据。

c# Newtonsoft 遍历 JArray 嵌套Json数组

2、是正确的JSON数据,在到后台调试。

3、后端代码如下: StreamReader str = new StreamReader(Request.InputStream); string vawee = str.ReadToEnd(); if (str != null) { str.Close(); } JArray listy = JArray.Parse(vawee); if (listy != null && listy.Count > 0) { foreach (JToken jt in listy) { foreach (IJEnumerable<JToken> jp in jt.Values()) { JsonArrayObjects QW = JsonObject.ParseArray(jt.ToString()); for (int j = 0; j < QW.Count; j++) { foreach (var qwqw in QW[j]) { Logger.Info(qwqw.Key + "------" + qwqw.Value); } } } } }正确解析如下图所示。

c# Newtonsoft 遍历 JArray 嵌套Json数组
  • 华为手机如何启动智慧语音
  • 怎么下载QQ炫舞游戏?
  • 日本抗衰老技术如何?
  • 蜜瓜奶冻怎么做?
  • 捣蛋猪骷髅攻略:[1]第一大关前5个
  • 热门搜索
    穿越成反派要如何活命 如何找人 华为麦芒4怎么样 商务英语专业怎么样 如何自制飞机杯 如何治早 旅游人类学 路由器管家 怎么说我不爱你简谱 南屏晚钟的南屏在哪里