爱玺玺

爱玺玺的生活日记本。wx:lb87626

poi 读取加密 xls文件

File f = new File(filePath);

InputStream inputStream = new FileInputStream(f);

Workbook xssfWorkbook = null;

//POIFSFileSystem poifsFileSystem = new POIFSFileSystem(inputStream);

//inputStream.close();

org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

.setCurrentUserPassword("308");

xssfWorkbook = WorkbookFactory.create(inputStream);

inputStream.close();



int sheets = xssfWorkbook.getNumberOfSheets();


发表评论:

Powered By Z-BlogPHP 1.4 Deeplue Build 150101

Copyright Your WebSite.Some Rights Reserved.

蜀ICP备11021721号-5