80,351
社区成员
发帖
与我相关
我的任务
分享
{"info":[{"id":"001","name":"001","cd":"10","state":0,"time":"30"},{"id":"002","name":"002","cd":"10","state":0,"time":"30"},{"id":"003","name":"003","cd":"10","state":0,"time":"30"},{"id":"004","name":"004","cd":"10","state":0,"time":"30"}],"Zongyeshu":3,"Dangqianye":1,"Shuliang":3,"Zongshu":23}
JSONObject resultJson=new JSONObject(strBuff.toString());
JSONArray infos = resultJson.getJSONArray("info");
for(int i = 0;i<infos.length();i++){
JSONObject info = (JSONObject)infos.get(i);
info.getString("id");
info.getString("cd");
}
String abc = "\"Zongyeshu\":3,\"Dangqianye\":1,\"Shuliang\":3,\"Zongshu\":23}";
String tempA[]=abc.split(",");
String tempB[]=tempA[0].split(":");
int Zongyeshu=Integer.valueOf(tempB[1]);
System.out.println("得到的总页数为:"+Zongyeshu);