The example in this article describes how C # transforms the JSON format into objects and replaces the key. Share to everyone for your reference. The specific analysis is as follows:
Because it is an non-standard serialized object type, you cannot implement it through standard deserialization classes, you need to customize a serialization class or a simple point, and directly customize a method to parse the JSON data. The parsed data is stored with dictionary.
?
1 2 3 4 5 6 |
String str = "{" name ":" 嬛 "," 2012-05-04 14:59 ":" 5724 "}"; Javascriptobject obj = javascriptconvert.deserializeobject (str) as Javascriptobject; foreach (keyvaluepair<string, object> K in obj) {Console.WriteLine ("Key:{0} Value:{1}", K.key, K.value); |
The output is as follows:
Key:name Value: Shing
key:2012-05-04 14:59 value:5724
I hope this article will help you with the C # program.