Parsing a JSON array using Json.Net

前端 未结 2 1252
挽巷
挽巷 2020-11-28 04:53

I\'m working with Json.Net to parse an array. What I\'m trying to do is to pull the name/value pairs out of the array and assign them to specific variables while parsing the

2条回答
  •  感动是毒
    2020-11-28 05:25

    Use Manatee.Json https://github.com/gregsdennis/Manatee.Json/wiki/Usage

    And you can convert the entire object to a string, filename.json is expected to be located in documents folder.

            var text = File.ReadAllText("filename.json");
            var json = JsonValue.Parse(text);
    
            while (JsonValue.Null != null)
            {
                Console.WriteLine(json.ToString());
    
            }
            Console.ReadLine();
    

提交回复
热议问题