Home > Backend Development > PHP Tutorial > 怎么让phpexcel生成的excel文件打开时需要密码

怎么让phpexcel生成的excel文件打开时需要密码

WBOY
Release: 2016-06-13 10:36:06
Original
1996 people have browsed it

如何让phpexcel生成的excel文件打开时需要密码
如题。
我搜索网上的一些解决方案说可以这样:

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$objPHPExcel=new PHPExcel();$objPHPExcel->getSecurity()->setLockWindows(true);$objPHPExcel->getSecurity()->setLockStructure(true);$objPHPExcel->getSecurity()->setWorkbookPassword("abc");$objWriter=new PHPExcel_Writer_Excel5($objPHPExcel);$objWriter->setTempDir(".");$objWriter->save("abc.xls");
Copy after login


但是生成的文件还是可以直接打开,不需要密码的。请问谁知道该怎么实现?

------解决方案--------------------
dddddd有道理!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template