[{" rowValue ": [{" the pop3access.componenttype" : "DepartmentField", "label" : "the expense department", "extendValue" : [{12, "number" : "name" : "the business of four", "id" : "104380371"}], "value" : "the business of four", "key" : "DepartmentField - K371IHGJ"}, {" the pop3access.componenttype ":" TextareaField ", "label" : "use", "value" : "the deposit replacement", "key" : "payment for"}, {" the pop3access.componenttype ":" DDSelectField ", "label" : "the currency of payment", "extendValue" : {" key ":" option_0} ", "value" : "yuan", "key" : "DDSelectField - K371IHGN"}, {" the pop3access.componenttype ":" MoneyField ", "label" : "payment amount (RMB)", "value" : "370000", "key" : "MoneyField - K371IHGO}]}]
Definition of the class the following
Public class extendValue
{
Public int number {get; The set; }
Public string name {get; The set; }
Public string id {get; The set; }
Public string key {get; The set; }
}
Public class rowValue
{
Public string the pop3access.componenttype {get; The set; }
Public string label {get; The set; }
public List
Public string value {get; The set; }
Public string key {get; The set; }
}
Parsing code below
JavaScriptSerializer JSSS=new JavaScriptSerializer ();
List
- (recValues. Value. The ToString ());
Foreach (rowValue rowValueItem in rowValueItems)
{}
//the code above, rowValue the attribute value is empty, all not parsing process, what is the problem, the column name what didn't see what is wrong, could you tell me what's the problem?
thank you
CodePudding user response:
Copy json, open vs, editing, selective paste, paste json for class,Then the class, can directly use,
If you must use your own rowValue, then compare the generated class, change the good,
CodePudding user response:
RecValues. Value. The ToString () Value is equal to the above the json string??CodePudding user response:
If you recValues. Value. The ToString () of the json string Value is equal to the above, that you want to convert the type of actually should be: List
List> List=JSSS. Deserialize > (json);
//the list [0] [" rowValue "] [0]. The pop3access.componenttype;
Otherwise, from the json string you have to put in front of: [{" rowValue ": and the back of the}] take out, otherwise the data format in
CodePudding user response:
RecValues. Value. The ToString () Value is equal to the above the json stringList
- > (json);
It still won't do,
The list of the Count directly returns 0
CodePudding user response:
Oh, please take out [{" rowValue ": after the entity class definition?This directly?
RowValue rowValueItems=JSSS. Deserialize
CodePudding user response:
The