标签:
不废话直接上代码 主要注意是 红色代码部分
Aspose.Cells.TxtLoadOptions lo = new TxtLoadOptions();
lo.Encoding = Encoding.Default;
//创建一个Workbook和Worksheet对象
Worksheet wkSheet = null;
Workbook wkBook = new Workbook(strFileName,lo);
wkBook.FileFormat = FileFormatType.CSV;
wkSheet = wkBook.Worksheets[SheetIndex];
Cells cells = wkSheet.Cells;
//读取标头数据
DataTable dt = cells.ExportDataTableAsString(SheetIndex, HeaderRowIndex, cells.MaxDataRow + 1, cells.MaxColumn + 1, true);
//释放对象
wkSheet = null;
wkBook = null;
//返回数据
return dt;
c# winForm使用Aspose.Cells读取CSV文件中文乱码问题
标签:
原文地址:http://www.cnblogs.com/Impulse/p/5630964.html