C# npoi判断excel具体行数
仅对有必填行数有有效
int countCol=0 // i为一定不为空的列 for (int i = 0; i <= headerRow.LastCellNum; i++) { if (sheet.GetRow(1).GetCell(i) == null) { break; } if (string.IsNullOrEmpty(sheet.GetRow(1).GetCell(i).ToString())) { break; } countCol = i; }

浙公网安备 33010602011771号