Надеюсь, кто-нибудь из вас сможет мне с этим помочь.
Код Я использую для десериализации и вызова объектов:
Код: Выделить всё
string file = "{\"status\":\"ok\",\"meta\":{\"count\":1},\"data\":{\"507888780\":[{\"all\":{\"spotted\":467,\"hits_percents\":83,\"wins\":281,},\"tank_id\":2849},{\"all\":{\"spotted\":224,\"hits_percents\":63,\"wins\":32,},\"tank_id\":9473}]}}";
Rootobject rootobject = JsonConvert.DeserializeObject(file);
Console.WriteLine(rootobject.data._507888780[1].tank_id);
Console.WriteLine(rootobject.data._507888780[1].all.hits_percents);
Код: Выделить всё
public class Rootobject
{
public string status { get; set; }
public Meta meta { get; set; }
public Data data { get; set; }
}
public class Meta
{
public int count { get; set; }
}
public class Data
{
public _507888780[] _507888780 { get; set; }
}
public class _507888780
{
public All all { get; set; }
public long tank_id { get; set; }
}
public class All
{
public long spotted { get; set; }
public long hits_percents { get; set; }
public long wins { get; set; }
}
https://dotnetfiddle.net/gwSA1C
Вы также посмотрите там строку JSON в более удобочитаемом виде.
Подробнее здесь: https://stackoverflow.com/questions/397 ... eexception
Мобильная версия