2012年7月6日
摘要: using System.Reflection; class Config { public string encoding { get; set; } public string plugins { get; set; } } 将hashtable的key值赋给实体类config. Hashtable ht = new Hashtable(); ht.Add("encoding", "utf8"); ht.Add("plugins", "xxxx"); Config config = ... 阅读全文
posted @ 2012-07-06 10:53 vingi_苍月 阅读(7687) 评论(0) 推荐(0) 编辑
摘要: C#中使用JSON不需要使用第三方库,使用.NET Framwork3.5自带的System.Runtime.Serialization.Json即可很好的完成JSON的解析。关于JSON的入门介绍见(首页的图很形象):http://www.json.org/一、Using需要添加引用:System.ServiceModel.Web 和 System.Runtime.Serialization,然后使用Using:usingSystem.Runtime.Serialization.Json;usingSystem.Runtime.Serialization;二、定义序列化的类假如我们要转化的J 阅读全文
posted @ 2012-07-06 00:40 vingi_苍月 阅读(4100) 评论(0) 推荐(0) 编辑