码迷,mamicode.com
首页 > Web开发 > 详细

json格式字符串处理

时间:2014-08-12 21:20:04      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:des   java   io   ar   div   line   javascript   new   

public class InternalClass
        {
            public int MID;
            public string Name;
            public string Des;
            public string Disable;
            public string Remark;
        }
 
        public class OuterClass
        {
            public bool phantom;
            public string id;
 
            public InternalClass data;
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            const string json = @"{""phantom"":true,
                                   ""id"":""ext-record-10"",
                                   ""data"":
                                  {""MID"":1019,
                                   ""Name"":""aaccccc"",
                                    ""Des"":""cc"",
                                    ""Disable"":""启用"",
                                    ""Remark"":""cccc""}}";
            JavaScriptSerializer ser = new JavaScriptSerializer();
            OuterClass foo = ser.Deserialize<OuterClass>(json); 
 
 
        }
 
 
JavaScriptSerializer类 需要引用System.Web.Extensions

json格式字符串处理,布布扣,bubuko.com

json格式字符串处理

标签:des   java   io   ar   div   line   javascript   new   

原文地址:http://www.cnblogs.com/mili3/p/3908020.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!