Deserialize JSON string to c# object

后端 未结 6 2116
轻奢々
轻奢々 2020-12-10 01:15

My Application is in Asp.Net MVC3 coded in C#. This is what my requirement is. I want an object which is in the following format.This object should be achieved when I deseri

6条回答
  •  旧时难觅i
    2020-12-10 01:51

    I think the JavaScriptSerializer does not create a dynamic object.

    So you should define the class first:

    class MyObj {
        public int arg1 {get;set;}
        public int arg2 {get;set;}
    }
    

    And deserialize that instead of object:

    serializer.Deserialize(str);
    

    Not testet, please try.

提交回复
热议问题