Get path of JSON value using JSON.NET

后端 未结 4 897
北恋
北恋 2021-01-11 12:14

I am trying to find a path of a JSON value. Consider the following JSON:

{
    \"car\": {
        \"type\": [{
            \"sedan\": {
                \"mak         


        
4条回答
  •  难免孤独
    2021-01-11 13:15

    you can Convert the Json to dynamic object as below.

    JavaScriptSerializer js=new JavaScriptSerializer();
    var dataObject=Json.Decode(jsonString);
    

    Then you can reflect over it and find out your string "honda" and construct the path as you like.

提交回复
热议问题