private static List<Test> OpenExcel(string path) { var records = new List<Test> { }; using (var reader = new StreamReader(path)) using (var csv = new CsvReader(reader)) { records = csv.GetRecords<Test>().ToList(); } return records; } class Test { public string D { get; set; } public string ONE { get; set; } public string TWO { get; set; } public string THREE { get; set; } public string FOUR { get; set; } public string FIVE { get; set; } public string SIX { get; set; } public string SEVEM { get; set; } public string EIGHT { get; set; } }
标签:set,读取,get,c#,var,csv,public,string From: https://www.cnblogs.com/ydc2023/p/16995741.html