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);
}
}
时间: 2024-11-03 10:22:45