乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 用<em>java</em>领域技术给<em>excel加密</em>?

用<em>java</em>领域技术给<em>excel加密</em>?

作者:乔山办公网日期:

返回目录:excel表格制作


首先你这个Excel文件是从哪里来的,很可能是从一个页面上下载来的,而这个页面做的功能就是导出Excel,但做偷懒了,没有用jxl和POI等库,而是用直接用jsp生成html写的。

因此你上传时就要要判断了,如果是真的excel就要用jxl或POI解析,如果只是html,就要用HTML的解析方法了。


抽象Java类实现。所有的具体工厂必须实现这个Java接口或继承这个抽象的Java类。
- 具体工厂(Factory)角色:这个角色直接在客户端的调用下创建产品的实例,这个角色含有选择合适的产品对象的逻辑,而这个逻辑是

Biff8EncryptionKey.setCurrentUserPassword("pass");
NPOIFSFileSystem fs = new NPOIFSFileSystem(new File("file.xls"), true);
HSSFWorkbook hwb = new HSSFWorkbook(fs.getRoot(), true);
Biff8EncryptionKey.setCurrentUserPassword(null);

// RC4 CryptoApi support ppt - decryption
Biff8EncryptionKey.setCurrentUserPassword("pass");
NPOIFSFileSystem fs = new NPOIFSFileSystem(new File("file.ppt"), true);
HSLFSlideShow hss = new HSLFSlideShow(fs);
...
// Option 1: remove password
Biff8EncryptionKey.setCurrentUserPassword(null);
OutputStream os = new FileOutputStream("decrypted.ppt");
hss.write(os);
os.close();
...
// Option 2: change encryption settings (experimental)
// need to cache data (i.e. read all data) before changing the key size
PictureData picsExpected[] = hss.getPictures();
hss.getDocumentSummaryInformation();
EncryptionInfo ei = hss.getDocumentEncryptionAtom().getEncryptionInfo();
((CryptoAPIEncryptionHeader)ei.getHeader()).setKeySize(0x78);
OutputStream os = new FileOutputStream("file_120bit.ppt");
hss.write(os);
os.close();

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网