Class CSVDataHelper
CSV数据帮助类
public class CSVDataHelper
- Inheritance
-
CSVDataHelper
- Inherited Members
- Extension Methods
Constructors
CSVDataHelper()
构造
public CSVDataHelper()
Properties
Enable
使能
public bool Enable { get; set; }
Property Value
FileFolder
文件夹名称
public string FileFolder { get; set; }
Property Value
FileFolderPath
保存路径(如果未指定将自动生成路径)
public string FileFolderPath { get; set; }
Property Value
FileName
文件名
public string FileName { get; set; }
Property Value
FileSuffixe
文件后缀
public string FileSuffixe { get; set; }
Property Value
HowManyDays
保存多少天
public int HowManyDays { get; set; }
Property Value
IsReadTitle
读取标题
public bool IsReadTitle { get; set; }
Property Value
Newline
换行符
public string Newline { get; set; }
Property Value
Title
第一行 标题
public string Title { get; set; }
Property Value
Methods
ConvertDataTableToVSV(DataTable, string)
将DataTable中数据写入到CSV文件中
public void ConvertDataTableToVSV(DataTable dt, string filePath)
Parameters
CopyCSV(string, string)
复制文件
public bool CopyCSV(string sourceFilePath, string destFilePath)
Parameters
Returns
Init()
初始化
public void Init()
ReadCSV(string)
读取csv文件
public string[] ReadCSV(string filePath)
Parameters
filePathstring路径
Returns
- string[]
string[]
ReadCSV(string, char)
读取csv文件
public DataTable ReadCSV(string filePath, char strSplit)
Parameters
Returns
- DataTable
DataTable
Write(string)
保存数据
public void Write(string content)
Parameters
contentstring保存内容