wanghan226 2021-10-10 20:30 采纳率: 0%
浏览 21

c# json 串解析问题

收到接口返回的 json 串:

{"code":0,"msg":"","data":{"sp000998":{"qfqday":[["2021-09-27","5.850","5.610","5.910","5.560","305300.000"],["2021-09-28","5.570","5.710","5.740","5.540","200538.000"],["2021-09-29","5.680","5.640","5.780","5.610","211602.000"],["2021-09-30","5.620","5.710","5.770","5.620","185429.000"],["2021-10-08","5.900","5.850","6.220","5.790","520652.000"]],"qt":{"sz000598":["51","\u5174\u84c9\u73af\u5883","000598","5.85","5.71","5.90","520652","243576","277076","5.84","1278","5.83","652","5.82","1564","5.81","604","5.80","1178","5.85","589","5.86","822","5.87","844","5.88","1146","5.89","877","","20211008161403","0.14","2.45","6.22","5.79","5.85/520652/312552254","520652","31255","1.74","13.01","","6.22","5.79","7.53","174.69","174.69","1.38","6.28","5.14","2.14","998","6.00","12.34","13.45","","","0.36","31255.2254","0.0000","0"," ","GP-A","24.44","0.17","1.70","10.59","4.21","6.22","4.36","4.84","5.41","14.48","2986218750","2986218750","10.45","23.91","2986218750"],"market":["2021-10-10 20:13:01|HK_close_\u5df2\u4f11\u5e02|SH_close_\u5df2\u4f11\u5e02|SZ_close_\u5df2\u4f11\u5e02|US_close_\u5df2\u4f11\u5e02|SQ_close_\u5df2\u4f11\u5e02|DS_close_\u5df2\u4f11\u5e02|ZS_close_\u5df2\u4f11\u5e02|NEWSH_close_\u5df2\u4f11\u5e02|NEWSZ_close_\u5df2\u4f11\u5e02|NEWHK_close_\u5df2\u4f11\u5e02|NEWUS_close_\u5df2\u4f11\u5e02|REPO_close_\u5df2\u4f11\u5e02|UK_close_\u5df2\u4f11\u5e02|KCB_close_\u5df2\u4f11\u5e02|IT_close_\u5df2\u4f11\u5e02|MY_close_\u5df2\u4f11\u5e02|EU_close_\u5df2\u4f11\u5e02|AH_close_\u5df2\u4f11\u5e02|DE_close_\u5df2\u4f11\u5e02|JW_close_\u5df2\u4f11\u5e02|CYB_close_\u5df2\u4f11\u5e02|USA_close_\u5df2\u4f11\u5e02|USB_close_\u5df2\u4f11\u5e02"],"zjlx":["sz000598","0.00","0.00","0.00","0","0.00","0.00","0.00","0","0.00","0.00","0.00","\u5174\u84c9\u73af\u5883","20200701","20200701^0.00^0.00","20200630^0.00^0.00","20200629^0.00^0.00","20200624^0.00^0.00","0.00","0.00","20200701085013"]},"mx_price":{"mx":{"data":[],"timeline":[]},"price":{"data":[]}},"prec":"5.840","version":"17"}}}

其中我只想获得 data 中的 qfqday 部分并解析为实体泛型List
sp000998 是商品编码,每次返回不同的商品信息json.

"data":{"sp000998":{"qfqday":[["2021-09-27","5.850","5.610","5.910","5.560","305300.000"],["2021-09-28","5.570","5.710","5.740","5.540","200538.000"],["2021-09-29","5.680","5.640","5.780","5.610","211602.000"],["2021-09-30","5.620","5.710","5.770","5.620","185429.000"],["2021-10-08","5.900","5.850","6.220","5.790","520652.000"]]

假设创建了实体 product 如何赋值 ?
对应实体属性:日期、早晨价格、中午价格、下午价格、晚上价格、成交额 的 product 实体中。

请教下具体方法:

目前尝试了 JObject jo = JObject.Parse(json 字符串); 获得的大对象杂乱无章,不太明了如何直接获得 data 中的 qfqday 下 各行数据到实体中。

  • 写回答

3条回答 默认 最新

    报告相同问题?

    相关推荐 更多相似问题

    问题事件

    • 创建了问题 10月10日

    悬赏问题

    • ¥15 gradle项目报错
    • ¥60 有关C#的问题,基础牢固的来
    • ¥15 Python算法设计Seam carving--让图片比例随心缩放
    • ¥15 页面制作,HTML CSS
    • ¥15 通个批处理实现 win7和win10 修改或设置:显示操作系统列表时间为2秒
    • ¥20 报错:Unsupported class file major version 59
    • ¥15 用ASP代码实现跨站脚本攻击
    • ¥50 ABP中怎样接收vue上传的图片
    • ¥15 uniapp设置音频的倍速播放无效
    • ¥15 关于#hc#的问题,如何解决?