Home > Net >  Dynamically add JObject elements in it, and how to traverse the values come out
Dynamically add JObject elements in it, and how to traverse the values come out

Time:01-29

The inside of the code is as follows, "not sure" unable to determine, because method obtained from upload pictures, but the fact is, how to take its value, please tall person to give directions
 public string insertHouseImg (int HouseID, int imgType=0) 
{
HouseImgModel I=new HouseImgModel ();
JObject j=new UpFile (.) SaveImg ();
Bool state=false;

If (j (" returnCode "] the ToString ()=="0000")
{

Foreach (JToken rs in j (" data "))
{


I. lider=rs [r]. "not sure" the ToString ();
I. lider_t=rs [r]. "not sure _t" ToString ();
I. lider_s=rs [r]. "not sure _s" ToString ();
I. ort=(int), rs (" sort ");
I.H ouseID=HouseID;
I.I mgType=0;
JsonDo. OperateData (I, DALHouse. InsertHouseImg);
The state=true;
}

}

Return JsonDo. StrToJson (state. The ToString (), "Data");

}

CodePudding user response:

Upload images obtained?

That also have to return value due to ah,, not may not be sure

CodePudding user response:

Can through the JObject objects of the Children () to obtain
 
Foreach (JProperty item in _jObject. The Children ())
{
STR. Append (item Name + "-- -" + item. The Value + "\ n");
}

If so, you don't know the corresponding you HouseImgModel attribute
So the JObject objects is known
  •  Tags:  
  • C#
  • Related