序列化Json格式

Json = JsonUtil.Serialize(new { code = 1, msg = "文件删除成功" });

public class JsonUtil
    {
        public static string Serialize(object o)
        {
            return new JavaScriptSerializer().Serialize(o);
        }
        public static void Serialize(object o, StringBuilder output)
        {
            new JavaScriptSerializer().Serialize(o, output);
        }
        public static T Deserialize<T>(string input)
        {
            return new JavaScriptSerializer().Deserialize<T>(input);
        }
    }
上一篇:学习CSS了解单位em和px的区别


下一篇:ZOJ 2974 Just Pour the Water