从JSON文件创建多个对象

时间:2015-07-09 19:33:09

标签: c# json object

我有一个JSON文件,它有许多JSON对象:

[
"DIEM":
{
    "Name":["A"],
    "InRul":[]
},
"DOAN":
{
    "Name":["A","B"],
    "InRul":[]
},
"TAMGIAC":
{
    "Name":["A","B","C"],
    "InRul":[]
},
"TAMGIACVUONG":
{
    "Name":["A","B","C"],
    "InRul":[]
}
]

并且,我在C#中有一个课程:

class Content
    {
        public string Name;
        public List<string> InRul;
    }

如何将上面的JSON文件转换为C#中的对象?

DIEM.Name //print Array [A]
DOAN.Name //print Array [A,B]

非常感谢!

0 个答案:

没有答案