如何使用C#/JSON.NET创建JSON文件? [英] How to create JSON file using C#/JSON.NET?
问题描述
大家好,
在JSON.Net(Newtonsoft)中使用JSONTextWriter或SerializeObject方法创建JSON文件(1-3MB)的最佳方法是什么?
请给我用于在JSON文件下面创建的示例C#代码;
{
"$ schema":"http://schema.aa.com/schemas/2015-05-01/mySchema1.json#",
"contentVersion":"1.0.0.0",
引擎":{
" cc" ;:" 2500" ;,
类型":拳击手"
}
参数":{
"名称" ;: {
"type":"String"
},
" Id" ;: {
"type":"String"
}
}
}
谢谢
Satheesh
http://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_Linq_JObject_Parse.htm
>
Hi All,
What is best way to create JSON file(1-3MB) using JSONTextWriter or SerializeObject method in JSON.Net(Newtonsoft)?
Please give me the sample C# code for creating below JSON file;
{
"$schema": "http://schema.aa.com/schemas/2015-05-01/mySchema1.json#",
"contentVersion": "1.0.0.0",
"Engine": {
"cc": "2500",
"type": "boxer"
},
"parameters": {
"Name": {
"type": "String"
},
"Id": {
"type": "String"
}
}
}
Thanks,
Satheesh
http://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_Linq_JObject_Parse.htm
这篇关于如何使用C#/JSON.NET创建JSON文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!