我想把我的Dictionary<int,List<int>>
转换成JSON字符串。有人知道如何在C#中实现这一点吗?
发布于 2011-04-08 23:46:33
如果语法有点小,我很抱歉,但我从中获得的代码最初是在VB中编写的:)
using System.Web.Script.Serialization;
...
Dictionary<int,List<int>> MyObj = new Dictionary<int,List<int>>();
//Populate it here...
string myJsonString = (new JavaScriptSerializer()).Serialize(MyObj);
https://stackoverflow.com/questions/5597349
复制相似问题