1 IWorkbook wk = null; 2 if (filePath.ToLower() == ".xls") 3 { 4 wk = new HSSFWorkbook(fs); 5 } 6 else 7 { 8 wk = new XSSFWorkbook(fs); 9 } 10
ps:对象HSSFWorkbook支持excel2003
对象HSSFWorkbook支持excel2007