1.创建json数组,例: JArray arrFile = new JArray(); arrFile.Add(new JObject() { new JProperty("FilePath",jArray[i]["FilePath"].ToString()),//文件路径 new JProperty("FileName",jArray[i]["FileName"].ToString()),//文件名 new JProper…
package com.zkn.newlearn.json; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.List; import java.util.Map; /** * Created by zkn on 2016/8/22. */ public class JsonToMapT…
package com.zkn.newlearn.json; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.List; import java.util.Map; /** * Created by zkn on 2016/8/22. */ public class JsonToMapT…
读取.json文件 public string GetFileJson(string filepath) { string json = string.Empty; using (FileStream fs = new FileStream(filepath, FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite)) { using (StreamReader sr = new StreamReader(fs, Encodin…