DataContractJsonSerializer 类 操作json类型数据
将对象序列化为 JavaScript 对象表示法 (JSON),并将 JSON 数据反序列化为对象。 此类不能继承。 // msdn 例子: 代码 namespace SL_DataContractJsonSerializer { public partial class Page : UserControl { public Page() { InitializeComponent(); } // This uses an event handler, not SL data binding void OnClick( object sender, EventArgs args) { txtOutput1.Text = " Create a User object and serialize it. " ; string json = WriteFromObject(); txtOutput2.Text = json.ToString(); // Displays: {"Age":42,"Name":"Bob"} txtOutput3.Text = " Deserialize the data to a User object. " ; string jsonString = " {'Name':'Bill', 'Age':53} " ; User