示例#1
0
 /// <summary>
 /// 将csv文本文件解析为一个数据表
 /// </summary>
 /// <param name="csvFile"></param>
 /// <param name="charset"></param>
 /// <returns></returns>
 public static DataTable ReadAll(string csvFile, Encoding charset)
 {
     using (CSVTextReader reader = new CSVTextReader(csvFile, charset))
     {
         return(reader.ReadAll());
     }
 }
示例#2
0
 /// <summary>
 /// 将csv文本解析为一个数据表
 /// </summary>
 /// <param name="csvText"></param>
 /// <returns></returns>
 public static DataTable ReadAll(string csvText)
 {
     using (CSVTextReader reader = new CSVTextReader(csvText))
     {
         return(reader.ReadAll());
     }
 }