Stream inputstream = Exceluploader.PostedFile.InputStream;
if (extenstion == ".xls")
{
//1. Reading from a binary Excel file ('97-2003 format; *.xls)
excelReader = ExcelReaderFactory.CreateBinaryReader(inputstream);
excelReader.IsFirstRowAsColumnNames = true;
}
if (extenstion == ".xlsx")
{
//...
//2. Reading from a OpenXml Excel file (2007 format; *.xlsx)
excelReader = ExcelReaderFactory.CreateOpenXmlReader(inputstream);
excelReader.IsFirstRowAsColumnNames = true;
}
目前我正在使用 ExcelDataReader 开源将流转换为 Excel 工作表,然后转换为数据集,同样我想在没有任何外部方工具或 dll 的情况下执行