如何设置JavaScriptSerializer格式化时,JSON序列化? [英] How to set formatting with JavaScriptSerializer when JSON serializing?

查看:191
本文介绍了如何设置JavaScriptSerializer格式化时,JSON序列化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JavaScriptSerializer进行序列化对象文件到JSON格式。但结果文件没有可读的格式。我怎样才能让格式化得到一个可读的文件?

I am using JavaScriptSerializer for serializing objects to the file to the JSON format. But the result file has no readable formatting. How can I allow formating to get a readable file?

推荐答案

这似乎是没有内置的工具格式化JSON串器的输出。
我想,为什么会这样被减少的数据,我们通过网络发送的原因。

It seemed to be that there is no built-in tool for formatting JSON-serializer's output.
I suppose the reason why this happened is minimizing of data that we send via network.

你确定,你需要在code格式的数据?或者你只是想在调试过程中analize JSON?

Are you sure that you need formatted data in code? Or you want to analize JSON just during debugging?

有很多的在线服务,提供这样的功能: 1 ,的 2 。 或者独立的应用程序: JSON观众

There is a lot of online services that provide such functionality: 1, 2. Or standalone application: JSON viewer.

但如果你需要格式化里面的应用程序,你可以写适当的code 自己。

But if you need formatting inside application, you can write appropriate code by yourself.

这篇关于如何设置JavaScriptSerializer格式化时,JSON序列化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆