[英]Encrypt excel file using ClosedXML
We are using ClosedXML library to generate our excel reports. 我们正在使用ClosedXML库来生成我们的Excel报告。 A new requirement form client is to password protect reports marked as confidential.
客户端的一项新要求是使用密码保护标记为机密的报告。 There is a method XLWorkbook.Protect() with some overloads, however, none of it is encrypting a file, just locking structure at best.
有一个带有一些重载的XLWorkbook.Protect()方法,但是,它没有一个在加密文件,最多只是锁定结构。 In other words, you can still see data after opening a file, MS Excel will not ask you for a password.
换句话说,打开文件后您仍然可以看到数据,MS Excel不会要求您输入密码。
Thanks 谢谢
After some try/fails and code disassembling I realized that ClosedXML is not supporting encryption at all; 经过几次尝试/失败和代码分解后,我意识到ClosedXML根本不支持加密;它只支持加密。 at least I was unable to find trace of it.
至少我找不到它的踪迹。 Maybe they will add it later.
也许他们稍后会添加。 We were able to convince client to give us a time to refactor the code and we are using EPPlus now.
我们能够说服客户给我们一些时间来重构代码,我们现在正在使用EPPlus。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.