Can someone please give some fair idea about how to use JSON?
-
3can you be more specific? What is your end-goal?Matt– Matt2009-09-23 12:49:57 +00:00Commented Sep 23, 2009 at 12:49
-
There are a lot of question on stackoverflow on this, see: stackoverflow.com/questions/158818/create-json-with-net stackoverflow.com/search?q=datacontractserializerCleiton– Cleiton2009-09-23 13:07:58 +00:00Commented Sep 23, 2009 at 13:07
Add a comment
|
4 Answers
Since there are no specifics, the best I can do is point you to a fairly complete how-to using .NET 3.5 to serialize an Object to JSON:
.NET 3.5: JSON Serialization using the DataContractJsonSerializer
Comments
I use JSON.NET (http://www.codeplex.com/Json) and I think it's a good library. The serialization is almost immediate:
string json = JsonConvert.SerializeObject(obj);
and vice versa:
JObject o = JObject.Parse(json);
Comments
Rick Strahl has written several excellent blog posts on the subject.
Try this post for starters: http://www.west-wind.com/weblog/posts/164419.aspx