asp.net - Convert JSON string to Dictionary in c# -
i have json string like
{ "action":"postrecord", "data":{ "0":{ "lid":999, "cid":1234 }, "1":{ "lid":111, "cid":"6789" } } }
and
i want co convert dictionary
object can data
, iterate on data[0][lid] = 999
data[0][cid] =1234
data[1][lid] = 111
data[1][cid] = 6789
the problem have use only native libraries of .net , have version 2.0
you can
dictionary<string, object> obj = jsonconvert.deserializeobject<dictionary<string, object>>(convert.tostring(data));
using json.net
Comments
Post a Comment