我一直在寻找Gzip是否支持多部分文件压缩.从我到目前为止看不到,但是当Gzip被选为压缩时,7z如何允许多部分压缩?这是否意味着7z内部负责多分区?
在Win7 x64上使用Delphi XE,有Jedi类库ver.3.45和7z.dll ver.9.20,
Uses .., jclcompression;
procedure TForm1.Button1Click(Sender: TObject);
const
an = 'C:\1.7z';
fn = 'C:\1.txt';
var Arc: TJclCompressArchive;
Ext: TJclCompressArchiveClass;
begin
Ext := GetArchiveFormats.FindCompressFormat(an);
Arc := Ext.Create(an);
Arc.AddFile(ExtractFileName(fn), fn);
Arc.Password:='123';
// arc. .. compresslevel:= 0..9 (or store..ultra)
// arc. .. compressmethod:= (lzma,lzma,bzip2,ppmd)
// arc. .. dictionarysize:= (1 shl 1..30)
// arc. .. comressheader:= true-false
// arc. .. cryptalgorithm:= ??? aes256 only?
// arc. .. threads:= 1..2
// arc. .. cryptheader:= true-false
Arc.Compress;
end;
Run Code Online (Sandbox Code Playgroud)
如何选择上面显示的压缩选项作为带"//"的注释?
绝地文件实际上是零,可能有人遇到这样的问题?
用7z尝试了一些不同版本的"作业":tSevenZip,SevenZipVcl,SevenZip Api,但已经得出结论,在项目Jedi中使用7z.dll工作的最新版本.
不确定是否存在这样的统一库或者算法是否是开源的.我需要能够解压缩尽可能多的类型,而无需安装任何其他应用程序.
我在构建过程中使用命令行中的7zip创建一个zip文件.使用这样的命令:
7z.exe a -pPassword"..\sot.zip".
此命令正常工作,我能够按预期看到加密文件.现在,当我添加加密头的功能时
7z.exe a -mhe = on -pPassword"..\sot.zip".7z.exe a -mhe + -pPassword"..\sot.zip".
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Scanning
Creating archive sot.zip
System error:
The parameter is incorrect.Run Code Online (Sandbox Code Playgroud)
我得到"参数不正确".错误无论我把它们放在命令行上的哪个位置.
有没有办法从命令行执行标头加密.
假设我已经有一个现有的 zip 文件Unprotected.zip。我想将密码保护添加到Unprotected.zip. 我想使用 7-zip 命令行版本来完成此任务。7-zip 命令行应该如何实现这个目标?
我正在尝试将通过将 excel 文件解压缩回 excel .xlsx 创建的 xml 文件夹转换。但我得到了错误
Microsoft Excel 无法打开或修复工作簿,因为它已损坏
生成此错误的最小可重现示例:
test.xlsxtest.ziptest.zip为文件夹testtest成test_new.ziptest_new.zip为test_new.xlsxtest_new.xlsx用 Excel打开对于压缩和解压缩,我使用了 7zip、WinZip 和 PeaZip,都具有相同的结果。我做错了什么,如何将解压缩的 Excel 工作簿恢复为原始形式?
Function Zip
{
Param
(
[string]$zipFile
,
[string[]]$toBeZipped
)
$CurDir = Get-Location
Set-Location "C:\Program Files\7-Zip"
.\7z.exe A -tzip $zipFile $toBeZipped | Out-Null
Set-Location $CurDir
}
$Now = Get-Date
$Days = "60"
$TargetFolder = "C:\users\Admin\Downloads\*.*"
$LastWrite = $Now.AddDays(-$Days)
$Files = Get-Childitem $TargetFolder -Recurse | Where {$_.LastWriteTime -le "$LastWrite"}
$Files
Zip C:\Users\Admin\Desktop\TEST.zip $Files
Run Code Online (Sandbox Code Playgroud)
我正在测试我在网上找到的脚本。我的问题是,不是压缩目标文件夹中的文件,而是复制并压缩7-zip程序文件文件夹的内容。是什么原因造成的?提前致谢
我的目标是避免来自VBA调试器的错误消息。需要检查已安装的7-zip版本,程序文件或程序文件(x86):
尝试做简单的“ IF”功能。
Dim PathZipProgram As String
strCommand As String
PathZipProgram = "C:\Program Files(x86)\7-Zip\7z.exe"
If Right(PathZipProgram, 1) Then
PathZipProgram = PathZipProgram
Else
PathZipProgram = "C:\Program Files\7-Zip\7z.exe"
End If
Shell strCommand
strCommand = """" & PathZipProgram & """ a -tzip """
Run Code Online (Sandbox Code Playgroud)
VBA找不到7zip。
从这里遵循教程后。我无法使用 lzma1900 SDK 生成可执行文件。
这是 powershell 的输出。
PS C:\Users\testbench\Downloads\7ZipSDK\CPP> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat
PS C:\Users\testbench\Downloads\7ZipSDK\CPP> nmake NEW_COMPILER=1
MY_STATIC_LINK=1 Build.mak
Microsoft (R) Program Maintenance Utility Version 14.16.27030.1 Copyright (C) Microsoft Corporation. All rights reserved.
if not exist "o" mkdir "o"
if not exist "o/asm" mkdir "o/asm"
link -nologo -OPT:REF -OPT:ICF /LARGEADDRESSAWARE /FIXED:NO -out:o\
oleaut32.lib ole32.lib user32.lib advapi32.lib shell32.lib
LINK : fatal error LNK1104: cannot open file 'o\'
NMAKE : fatal error U1077: '"C:\Program Files …Run Code Online (Sandbox Code Playgroud) 我使用 Delphi 7 的 7zip 包装器,效果很好
https://github.com/zedalaye/d7zip
它创建存档但覆盖里面已有的文件
var
Arch: I7zOutArchive;
begin
Arch := CreateOutArchive(CLSID_CFormat7z);
SetCompressionLevel(Arch, 2);
Arch.AddFile('C:\Test.bin', 'Test.bin');
Arch.SaveToFile('C:\Test.zip');
end;
Run Code Online (Sandbox Code Playgroud)
它删除了保存在“Test.zip”中的所有其他文件无论如何我可以将文件保存在“Test.zip”中并在 Delphi 7 中使用此包装器编写新文件
7zip ×10
zip ×3
c++ ×2
compression ×2
delphi ×2
command-line ×1
delphi-7 ×1
encryption ×1
excel ×1
gzip ×1
header ×1
makefile ×1
passwords ×1
powershell ×1
rar ×1
scripting ×1
target ×1
vba ×1
visual-c++ ×1
xml ×1