Question

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
					
public class Program
{
	public static void Main()
	{
		string json = "{clients: {'clientname1':{'sha1':'shahashhere','url':'urlhere'},'clientname2':{'sha1':'shahashhere','url':'urlhere'}}}";
		
			List<List<String>> matrix = new List<List<String>>();
            matrix.Add(new List<String>());
            try
            {
				Client cc = new Client();
				Downloads download = new Downloads();
                download = JsonConvert.DeserializeObject<Downloads>(json);

                foreach (KeyValuePair<string, Client> kvp in download.clients)
                {
                    Console.WriteLine("URL: " + kvp.Value.url);
                    Console.WriteLine("SHA1: " + kvp.Value.sha1);
                    matrix[0].Add(kvp.Value.url);
                    matrix[0].Add(kvp.Value.sha1);
                }
            }
            catch (JsonReaderException jex)
            {
                throw;
            }
	}

    class Downloads
    {
        [JsonProperty("clients")]
        public Dictionary<string, Client> clients { get; set; }
    }

    class Client
    {
        [JsonProperty("url")]
        public string url { get; set; }
        [JsonProperty("sha1")]
        public string sha1 { get; set; }
    }
}
;