Answers for "get json data from string c#"

2

c# get value from json object

using System;
using Newtonsoft.Json.Linq;

namespace testClient
{
    class Program
    {
        static void Main()
        {
            var myJsonString = "{report: {Id: \"aaakkj98898983\"}}";
            var jo = JObject.Parse(myJsonString);
            var id = jo["report"]["Id"].ToString();
            Console.WriteLine(id);
            Console.Read();
        }
    }
}
Posted by: Guest on June-11-2021
0

how get data from json in c#

public class JSONResponse
{
    public string status { get; set; }
    public List<Article> articles { get; set; }
}


JSONResponse response = JsonConvert.DeserializeObject<JSONResponse>(myJSON);
Posted by: Guest on April-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language