引用这个玩意,在Json50r3中,下载地址就不写了
using Newtonsoft.Json;
定义一个类,用于接收JSON数组
public class Pay
{
public string ORGCODE;
public string SALENO;
public string ZFNO;
public string ZFCODE;
public string ZFTOTAL;
public string SSTOTAL;
public string SERIALNO;
}
这样就可以获得
string sjson=“这里存JSON数组”;
Pay[] pay = JsonConvert.DeserializeObject<Pay[]>(sjson);
// 这就可以用了
for (int i = 0; i < pay.Length; i++)
{
str.AppendFormat("{0},{1},{2},'{3}','{4}')", new string[] { pay[i].ZFTOTAL, pay[i].ZFTOTAL, pay[i].SSTOTAL,"2","1" });
}