public static CellListJson LoadJsonFile(string path) { string jsonText; try { jsonText = File.ReadAllText(path, Encoding.UTF8); } catch (Exception) { MessageBox.Show("打开文件错误"); return(null); } CellListJson objJson = JsonConvert.DeserializeObject <CellListJson>(jsonText); // FileStream fs = new FileStream(path, FileMode.Open); string md5 = GenerateMD5(fs); objJson.md5 = md5; return(objJson); }
/// 生成cell list private void GenerateCellList(String path) { json = JsonHelp.LoadJsonFile(path); ReloadCellList(); }
public static void ListToFile(CellListJson list, string path) { ObjToFile(list, list.name + ".cell", path); }