对象转json

private string GetToJson(object dic)
        {
            //实例化JavaScriptSerializer类的新实例
            JavaScriptSerializer jss = new JavaScriptSerializer();
            try
            {
                //将对象序列化为json数据
                return jss.Serialize(dic);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
 
        }

对象转json,布布扣,bubuko.com

对象转json

上一篇:如何改计算机用户名(administrator)


下一篇:MVC之前的那点事儿系列(8):UrlRouting的理解