zoukankan      html  css  js  c++  java
  • json格式字符串处理

    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
  • 相关阅读:
    sql server mdx
    mysql 按照 汉字的第一个拼音排序
    转,mysql的select * into
    mysql 日期的操作
    google 地图api
    ip_test
    AJAX (转w3cschool)
    jquery ajax 失败
    安装AdventureWorks2008R2示例数据库
    弹出新的网页窗口 js
  • 原文地址:https://www.cnblogs.com/mili3/p/3908020.html
Copyright © 2011-2022 走看看