private
string
GetToJson(
object
dic)
{
//实例化JavaScriptSerializer类的新实例
JavaScriptSerializer jss =
new
JavaScriptSerializer();
try
{
//将对象序列化为json数据
return
jss.Serialize(dic);
}
catch
(Exception ex)
{
throw
new
Exception(ex.Message);
}
}
原文地址:http://www.cnblogs.com/sanzang/p/3777133.html