序列化对象 public class People { [XmlAttribute("NAME")] public string Name { set; get; } [XmlAttribute("AGE")] public int Age { set; get; } } [XmlRoot("Root")] public class Student : People { [XmlElement("CLASS")] public
c# XML序列化与反序列化 原先一直用BinaryFormatter来序列化挺好,可是最近发现在WinCE下是没有办法进行BinaryFormatter操作,很不爽,只能改成了BinaryWriter和BinaryReader来读写,突然想到能不能用XML来序列化?于是在网上查了些资料便写了些实践性代码,做些记录,避免以后忘记. 序列化对象 public class People { [XmlAttribute("NAME")] public string Name { set; g
纠结了两天的json数组反序列化,终于在同事的帮助下,找到方法了,特作笔记如下: using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Text; string jsonText = "[{'a':'aaa','b':'bbb','c':'ccc'},{'a':'aaa2','b':'bbb2','c':'ccc2'}]"; JArray ja = (JArray)JsonConvert.DeserializeO
1.安装:http://www.cnblogs.com/dudu/archive/2009/07/19/1526669.html 2.使用 using Enyim.Caching.Configuration; using Enyim.Caching.Memcached; using Enyim.Caching; using System.IO; public class HomeController : Controller { public ActionResult Index() { str