• 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
  • 相关阅读:
    Hibernate中的一对一注解配置
    Hibernate=====HQL实用技术
    Hibernate中的session的线程安全问题
    初学orcale(一)
    initBinder转换日期格式
    poi学习
    jqueryUI学习
    JavaScript中node的相关属性
    JavaScript函数的调用(通过节点)--JavaScript DOM编程艺术
    DOM中的四种方法--Javascript DOM编程艺术
  • 原文地址:https://www.cnblogs.com/mili3/p/3908020.html
Copyright © 2020-2023  润新知