111,094
社区成员




using System.Collections.Generic;
using Newtonsoft.Json;
namespace JsonTest
{
internal class JsonTestClass : Dictionary<string, string>
{
public JsonTestClass()
{
TestProperty = "测试内容";
Add("测试键", "测试值");
var json = JsonConvert.SerializeObject(this, Formatting.Indented);
//此处得到的json内容为:
//"{\r\n \"测试键\": \"测试值\"\r\n}"
}
public string TestProperty { get; set; }
}
}