日期:2014-05-16 浏览次数:20343 次
/// <summary> /// 将对象序列化为json数据 /// </summary> private string GetToJson(object dic) { //实例化JavaScriptSerializer类的新实例 JavaScriptSerializer jss = new JavaScriptSerializer(); try { //将对象序列化为json数据 return jss.Serialize(dic); } catch (Exception ex) { throw new Exception(ex.Message); } }