简单的给你做了下解析,具体要解析到什么程度,你自己看吧。大概解析方法就是这样的:
如下:
privatevoid testJson(){
String JsonData = "[{\"id\":[\"386\",\"381\",\"379\",\"377\"],\"num\":[\"386\",\"381\",\"379\",\"377\"]},{\"id\":[\"3860\",\"3810\",\"3790\",\"3770\"],\"num\":[\"3860\",\"3810\",\"3790\",\"3770\"]}]";
JSONObject obj = null;
JSONArray jsonArary;
try {
jsonArary = new JSONArray(JsonData);
for(int i=0;i
//取ID
JSONArray strID = obj.getJSONArray("id");
for(int j=0;j
}
//取num
JSONArray strNum = obj.getJSONArray("num");
for(int k=0;k
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
public struct Person
{
public string Name {get;set;}
public string Sex {get;set;}
}
public struct Information
{
public string Address {get;set;}
public string Phone {get;set;}
}
public struct Test
{
public string cd {get;set;}
public string ph {get;set;}
}
//主解析对象1
public struct JsonModel1
{
public List{get;set;}
public List{get;set;}
public List{get;set;}
}
public struct JsonModel2
{
public string Status {get;set;}
public List{get;set;}
public List{get;set;}
public List{get;set;}
}