示例#1
0
    /// <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.";
    }
示例#2
0
    /// <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;
    }
示例#3
0
文件: CSVUtil.cs 项目: cnscj/THSTG
 public static string Encode(CSVTable table)
 {
     return(table.GetContent());
 }