i created 1 dynamic json string
{"attributecollection":{"soid":"so1","bucode":"bu1","clientcode":"clc1","paymentstatus":"true"},"input":{"soid":"so1","bucode":"bu1","clientcode":"clc1","paymentstatus":"true"},"output":{}}
so after can access values string converting dynamic , value.but in scenario want add values in output after time.so how that.after converting dynamic can add values or again want construct json string including output.is there other option this.help appreciated.
you want convert json string native type access it's values, change them, , create new json string data again. there plenty of solutions on internet can find, including many thirt-party libraries. can recommend http://sourceforge.net/projects/jsonlib/?source=directory written myself, , here example how use it:
string jsonstring = "{\"key1\":\"value1\",\"key2\":2}"; // input string jsonobject jsonobject = jsonobject.parse(jsonstring); // parse string jsonobject["key1"] = 1; // modify key1 jsonobject["key3"] = "value3"; // add key3 jsonstring = jsonobject.tostring(); // create json string
i hope that's looking for. if interesting more information of how use library refer included examples , wiki pages.
Comments
Post a Comment