csv helper

CsvReader / CsvWriter 是用來讀寫csv檔案用的
/// <summary>
///A test for ReadCsvFile
///</summary>
[TestMethod(), DeploymentItem("readFile.txt")]
public void CsvHelpCsvTest()
{
    using (FileStream fileStream = new FileStream("readFile.txt", FileMode.Open, FileAccess.Read))
    using (StreamReader reader = new StreamReader(fileStream, Encoding.UTF8))
    using (CsvReader csv = new CsvReader(reader))
    {
        csv.Read();
        var content = csv.GetRecords<BatchIdResponse>();
    }
}

你可能感兴趣的:(csv helper)