weilaixiaoshi
未来小师
2019-05-17 16:37

求助,C# Json序列化(嵌套)

10
  • c#
  • json
  • 开发语言

需要用C#生成如下的json数据,求C#代码。

可能需要用到的引用:using System.Web.Script.Serialization;

{
    "state":"ok",
    "row":21,
    "col":19,
    "firstData":[
        "会议日期",
        "会议时间",
        "星期",
        "第一会议室",
        "第二会议室",
        "第三会议室"
    ],
    "tableData":[
        {
            "meetingDate":"2019-01-05",
            "meetingTime":"14:30",
            "meetingWeek":"周一",
            "otherData":[
                {
                    "meetingRng":[
                        {
                            "meetingCase":"会议主题1",
                            "meetingRem":"会议备注"
                        }
                    ],
                    "meetingName1":"张三",
                    "meetingName2":"李四",
                    "meetingName3":"王五"
                },
                {
                    "meetingRng":[
                        {
                            "meetingCase":"会议主题2",
                            "meetingRem":"会议备注"
                        }
                    ],
                    "meetingName1":"张三1",
                    "meetingName2":"李四2",
                    "meetingName3":"王五3"
                }
            ]
        },
        {
            "meetingDate":"2019-01-05",
            "meetingTime":"16:30",
            "meetingWeek":"周一",
            "otherData":[
                {
                    "meetingRng":[
                        {
                            "meetingCase":"会议主题2",
                            "meetingRem":"一个备注"
                        }
                    ],
                    "meetingName1":"赵六",
                    "meetingName2":"马二",
                    "meetingName3":"许可"
                }
            ]
        }
    ]
}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答