如何最好用给定的结构解析json文件

时间:2016-07-01 15:54:50

标签: c# json dictionary

我有一个json文件,结构如下:

buildbot

使用给定的模式,其中键是图像的某个路径,值是序列化的颜色[,](颜色矩阵或Color对象的二维数组)。每个条目,每个键都用这个8x8数组描述(值是图像每个块的RGB值)。 我希望它存储在Dictionary中,因为其他应用程序逻辑使用Color [,]结构作为输入,产生一些输出等等。 如果我执行:

{ "F:\\MyProject\\shopping\\images\\img_bags_clutch_10.jpg": [ [ "254, 254, 254", "215, 216, 217", "181, 181, 183", "240, 240, 241", "254, 254, 254", "254, 254, 254", "255, 255, 255", "255, 255, 255" ], [ "190, 187, 183", "89, 85, 83", "98, 90, 81", "94, 92, 90", "118, 118, 121", "144, 144, 146", "253, 253, 253", "255, 255, 255" ], [ "248, 247, 246", "213, 206, 193", "177, 176, 173", "63, 63, 63", "88, 89, 92", "165, 165, 166", "235, 235, 235", "254, 254, 254" ], [ "255, 255, 255", "250, 250, 249", "227, 221, 208", "99, 99, 99", "98, 98, 98", "96, 94, 90", "92, 90, 87", "215, 216, 217" ], [ "255, 255, 255", "255, 255, 255", "235, 235, 235", "93, 94, 96", "36, 38, 42", "43, 44, 47", "64, 66, 68", "158, 159, 161" ], [ "255, 255, 255", "255, 255, 255", "255, 255, 255", "254, 254, 254", "199, 199, 199", "75, 77, 79", "132, 133, 132", "141, 140, 141" ], [ "255, 255, 255", "255, 255, 255", "255, 255, 255", "255, 255, 255", "255, 255, 255", "220, 219, 218", "67, 65, 62", "137, 137, 137" ], [ "255, 255, 255", "255, 255, 255", "255, 255, 255", "255, 255, 255", "255, 255, 255", "255, 255, 255", "215, 216, 217", "224, 224, 225" ] ],....

关键元素没问题,但值始终是第一个Color [,]结构。

0 个答案:

没有答案