//using System;
//using System.Text;

//namespace DAL
//{
//    public class CSV
//    {
//        private readonly string PATH;
//        private string[][] content;

//        public CSV(string path)
//        {
//            try
//            {
//                PATH = path;
//                if (!System.IO.File.Exists(path))
//                    System.IO.File.WriteAllText(path, "", Encoding.UTF8);
//                string[] lines = System.IO.File.ReadAllLines(path, Encoding.UTF8);

//                content = new string[lines.Length][];
//                for (int i = 0; i < lines.Length; i++)
//                    content[i] = lines[i].Split(',');
//            }
//            catch (Exception ex)
//            {
//                content = new string[0][];
//                Common.log.Error("CSV.Open", ex);
//            }
//        }

//        public string[][] Read()
//        {
//            return content;
//        }

//        public string[] Read(int row)
//        {
//            if (row >= content.Length)
//                return null;
//            else
//                return content[row];
//        }

//        public void Save()
//        {
//            try
//            {
//                string[] lines = new string[content.Length];
//                for (int i = 0; i < content.Length; i++)
//                    lines[i] = string.Join(",", content[i]);

//                System.IO.File.WriteAllLines(PATH, lines);
//                Common.log.Debug("文件已保存," + PATH);
//            }
//            catch (Exception ex)
//            {
//                Common.log.Error("CSV.Save", ex);
//            }
//        }

//    }
//}