其他分享
首页 > 其他分享> > NOPI读取Excel

NOPI读取Excel

作者:互联网

NOPI读取Excel

string filePath = "C:/Users/29939/Desktop/当前项目文件/图像资源/test/Result/result_202107271603421888/final_result.major";
string sheet = "Confidence";
HSSFWorkbook wb = new HSSFWorkbook(new FileStream(filePath, FileMode.Open, FileAccess.Read));
HSSFSheet sht = (HSSFSheet)wb.GetSheet(sheet); //如果是2003 则用HSS开头的对象。
FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read);
//XSSFWorkbook xworkbook = new XSSFWorkbook(file);
//XSSFSheet xsheet = (XSSFSheet)xworkbook.GetSheet(sheet);
int rowsCount = sht.PhysicalNumberOfRows; //取行Excel的最大行数
int colsCount = sht.GetRow(0).PhysicalNumberOfCells;//取得Excel的列数

标签:sht,sheet,读取,filePath,FileStream,Excel,NOPI,new
来源: https://blog.csdn.net/qq_41375318/article/details/119146828