JSON to Dictionary C#.Net 2.0 Standart

问题描述 投票:0回答:1

我正在以该格式下载JSON(无法更改...):

[
{"Id":183,"description":"blahblahblah"},
{"Id":184,"description":"blehblehbleh"},
{"Id":1000,"description":"and so on..."}
]

如何将其转换成类似字典的形式>

{
{"blahblahblah", "183"},
{"blehblehbleh", "184"},
{"and so on...", "1000"}
}

我正在使用C#.Net Standart 2.0(也许我可以使用.Net 4.x)

谢谢。

我正在以该格式下载JSON(无法更改...):[{“ Id”:183,“ description”:“ blahblahblah”},{“ Id”:184,“ description”:“ blehblehbleh” },{“ Id”:1000,“ description”:“依此类推...”}]我如何...

c# json dictionary .net-2.0
1个回答
0
投票

您可以使用Newtonsoft.Json将JSON反序列化为字典。

© www.soinside.com 2019 - 2024. All rights reserved.