Table of Contents

Class CSVDataHelper

Namespace
AT.Librarys.Container.Utility
Assembly
AT.Librarys.Container.dll

CSV数据帮助类

public class CSVDataHelper
Inheritance
CSVDataHelper
Inherited Members
Extension Methods

Constructors

CSVDataHelper()

构造

public CSVDataHelper()

Properties

Enable

使能

public bool Enable { get; set; }

Property Value

bool

FileFolder

文件夹名称

public string FileFolder { get; set; }

Property Value

string

FileFolderPath

保存路径(如果未指定将自动生成路径)

public string FileFolderPath { get; set; }

Property Value

string

FileName

文件名

public string FileName { get; set; }

Property Value

string

FileSuffixe

文件后缀

public string FileSuffixe { get; set; }

Property Value

string

HowManyDays

保存多少天

public int HowManyDays { get; set; }

Property Value

int

IsReadTitle

读取标题

public bool IsReadTitle { get; set; }

Property Value

bool

Newline

换行符

public string Newline { get; set; }

Property Value

string

Title

第一行 标题

public string Title { get; set; }

Property Value

string

Methods

ConvertDataTableToVSV(DataTable, string)

将DataTable中数据写入到CSV文件中

public void ConvertDataTableToVSV(DataTable dt, string filePath)

Parameters

dt DataTable

提供保存数据的DataTable

filePath string

文件路径

CopyCSV(string, string)

复制文件

public bool CopyCSV(string sourceFilePath, string destFilePath)

Parameters

sourceFilePath string
destFilePath string

Returns

bool

Init()

初始化

public void Init()

ReadCSV(string)

读取csv文件

public string[] ReadCSV(string filePath)

Parameters

filePath string

路径

Returns

string[]

string[]

ReadCSV(string, char)

读取csv文件

public DataTable ReadCSV(string filePath, char strSplit)

Parameters

filePath string

路径

strSplit char

行分隔符号

Returns

DataTable

DataTable

Write(string)

保存数据

public void Write(string content)

Parameters

content string

保存内容