{"items":[{"key":1,"val":"one"},{"key":2,"val":"two"},{"key":3,"val":"three"},{"key":4,"val":"four"}]}
//data - десериализованный json массив
foreach(string value in data) {
print("ID: " + value.key + ", TEXT: " + value.val);
}
static void Main()
{
var afterWebRequests = "{\"items\":[{\"key\":1,\"val\":\"one\"},{\"key\":2,\"val\":\"two\"},{\"key\":3,\"val\":\"three\"},{\"key\":4,\"val\":\"four\"}]}";
var temp = (MyArray)JsonConvert.DeserializeObject(afterWebRequests, typeof(MyArray));
foreach(Item item in temp.items)
{
Console.WriteLine("Key: {0}, Value {1}", item.key, item.val);
}
Console.ReadKey();
}
public class MyArray
{
public List<Item> items { get; set; }
}
public class Item
{
public int key { get; set; }
public string val { get; set; }
}