/// <summary> /// 检查第四行 /// </summary> /// <returns></returns> private bool check4thRow(List <String> excelPathList, out int maxColIndex) { maxColIndex = 0; //先清除所有记录。 AR_Temp.deleteTheARTemp(); foreach (string excelPath in excelPathList) { //打开文档 MyExcel myExcel = new MyExcel(excelPath); myExcel.open(); Worksheet firstWS = myExcel.getFirstWorkSheetAfterOpen(); string fileNameWithoutSuffix = DirectoryHelper.getFileNameWithoutSuffix(excelPath); int checkedColIndex = 0; if (!AttendanceRHelper.isAllDigit(firstWS, 4, out checkedColIndex)) { myExcel.close(); lblPrompt.Visible = false; ShowResult.show(lblResult, fileNameWithoutSuffix + ": 第4行" + checkedColIndex.ToString() + "列非数字; 导入取消。", false); timerRestoreTheLblResult.Start(); return(false); } if (maxColIndex == 0) { Usual_Excel_Helper uEHelper = new Usual_Excel_Helper(firstWS); maxColIndex = uEHelper.getMaxColIndexBeforeBlankCellInSepcificRow(4); } myExcel.close(); } return(true); }