FastJson 反序列化Dictionary

sakura03jc sakura03jc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
需要反序列化的Json为 {"test1":0,"test2":"This is a test"} ,这样既有int,也有string类型的,所以需要Dictionary<string, object>类型,但在使用FastJson反序列化时,调用
Dictionary<string, object> d = FastJson.Deserialize<Dictionary<string, object>>(json);
会报错 FormatException: failed read char '{'. index = 10 text = "t1":0,"tes"
想要的结果是
d["test1"] = (int)0;
d["test2"] = (string)"This is a test";
请问怎样解决呢?感谢!!
...全文

相关推荐

评论 11
收藏 已收藏
分享
返回顶部
sakura03jc
C# 111,128 成员 642,536 内容