JSON and C# System.Web.Script.Serialization.JavaScriptSerializer alternative
I was using JavaScriptSerializer to handle JSON serialization, but because of some unforeseen problems (my bad luck) I have to use something else.
All I need from serializer looks lie this:
string json = "..."
JavaScriptSerializer ser = new JavaScriptSerializer();
Dictionary<string, Object> o = ser.Deseria开发者_开发百科lize<Dictionary<string, Object>>(json);
So I end up with a dictionary that contains other dictionaries/arrays/objects that represents json hierarchical structure. I already have a code that does some analysis on data structured like that, and I don't want to change that part.
Which JSON parser for C# can provide such functionality?
you can use json.net or fastjson opensource libraries to perform this task in a faster and more efficient way than using the built in .net serializer.
json.net - http://json.codeplex.com/
fastJson - http://www.codeproject.com/Articles/159450/fastJSON
精彩评论