/// <summary> /// 序列化 /// </summary> /// <param name="obj">对象</param> public string Serialize(object obj) { System.Web.UI.LosFormatter los = new LosFormatter(); StringWriter writer = new StringWriter(); los.Serialize(writer, obj); return writer.ToString(); } /// <summary> /// 反序列化 /// </summary> /// <param name="serialize"></param> /// <returns></returns> public object DeSerialize(string serialize) { System.Web.UI.LosFormatter los = new LosFormatter(); return los.Deserialize(serialize); }