使用新的System.Json from 4.5或等效的System.Json for 4.0 from Nuget如何格式化输出,以便以更易读的形式缩进和间隔?如何用System.Json漂亮打印?
所以这
dynamic jsonObj = new JsonObject();
jsonObj.firstName = "John";
jsonObj.lastName = "Smith";
Debug.WriteLine((string)jsonObj.ToString());
输出这个
{"firstName":"John","lastName":"Smith"}
当我想这个
{
"firstName": "John",
"lastName": "Smith"
}