是否可以在Ruby中创建一个受密码保护的Excel文件。
下面的Gem:帮助你用密码对单元格进行“写保护”。但是,要求对整个Excel文件进行密码保护,这样用户就不能在没有密码的情况下打开工作簿。就像我们可以从Excel本身做的那样,Excel中的"Encrypt with Password“选项。
任何人都知道有没有宝石。或者任何可以帮助我们加密Excel文件的代码片段或指针,正如微软所期望的那样。
我正在用PHP创建一个给定文件的zip文件。下面是函数
function create_zip($file, $file_name)
{
$zip = new ZipArchive();
$zip_name = $file_name. ".zip"; // Zip name
$zip->open($zip_name, ZipArchive::CREATE);
if (file_exists($file)) {
$zip->addFromString(basename($file), file_get_co
我想创建受密码保护的ZIP:
// Set the compression level
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
// Set the encryption flag to true
// If this is set to false, then the rest of encryption properties are ignored
parameters.setEncryptFiles(true);
// Set the en
我正在尝试通过VBA打开Excel (xlsm)文件。它可能使用(已知的)密码保护,也可能不使用。我使用的是以下代码:
On Error Resume Next
Workbooks.Open filename, Password:=user_entered_pw
opened = (Err.Number=0)
On Error Goto 0
现在,如果工作簿有密码,则可以很好地工作。但如果它没有保护,就不能打开。显然,如果还有工作簿结构保护处于活动状态,这是XL2007中的一个错误。()。在旧的XL2003上,提供密码将同时打开未保护和密码保护的文件。
我试过了:
Workbooks.Open
我已经挣扎了几个小时,试图在压缩文件夹上设置密码。然而,无论我多少次尝试使用不同的代码,密码都应用于zip文件夹中的每个文件,这不是我想要的。我只想将密码应用到文件夹本身,不应该将密码设置为内部的各个文件。
这是我的代码:(关于您的信息,我使用DotNetZip)
//Assume that there is a folder with multiple files in it at C:\\ExampleFolder
using (Ionic.Zip.ZipFile z = Ionic.Zip.ZipFile())
{
z.Password = "MyPassword"
我需要在node.js中创建一个有密码保护的ZIP文件。
我使用的是"node-zip“模块,不幸的是它不支持密码保护:
var zip = new require('node-zip')();
zip.file('test.file', 'hello there');
var data = zip.generate({base64:false,compression:'DEFLATE'});
查找其他节点模块来创建ZIP文件,我没有发现任何支持密码保护的模块。