/// <summary> /// 存储文件 /// </summary> private void Save() { if (_table == null) { Debug.LogError("The table is null."); return; } string tableContent = _table.GetContent(); if (!Directory.Exists(_savePath)) { Debug.Log("未找到路径, 已自动创建"); Directory.CreateDirectory(_savePath); } string fullFileName = _savePath + _fileName + EXTENSION; StreamWriter sw; sw = File.CreateText(fullFileName); sw.Write(tableContent); sw.Close(); sw.Dispose(); _table = null; _display.text = "Save."; }
/// <summary> /// Save方法生成QTableyyyyMMdd形式csv文件,调用该方法后不应再使用类对象 /// </summary> public void Save() { if (_table == null) { Debug.LogError("The table is null."); return; } string tableContent = _table.GetContent(); if (!Directory.Exists(filePath)) { Debug.Log("未找到路径, 已自动创建"); Directory.CreateDirectory(filePath); } //保存csv名称为QTableyyyyMMdd.csv string fullFileName = filePath + fileName + System.DateTime.Now.ToString("yyyyMMdd") + EXTENSION; StreamWriter sw; sw = File.CreateText(fullFileName); sw.Write(tableContent); sw.Close(); sw.Dispose(); _table = null; }
public static string Encode(CSVTable table) { return(table.GetContent()); }