Parsing json objects

前端 未结 7 702
Happy的楠姐
Happy的楠姐 2020-12-09 20:51

I\'m having trouble understanding how to parse JSON string into c# objects with Visual .NET. The task is very easy, but I\'m still lost... I get this string:



        
7条回答
  •  醉酒成梦
    2020-12-09 21:25

    The usual way would be create a class (or a set of classes, for more complex JSON strings) that describes the object you want to deserialize and use that as the generic parameter.

    Another option is to deserialize the JSON into a Dictionary:

    parser.Deserialize>(source);
    

    This way, you can access the data, but I wouldn't suggest you to do this unless you have to.

提交回复
热议问题