//This API use the 7-zip dll (7z.dll) to read and write all 7-zip supported archive formats.
//- Autor: Henri Gourvest <hgourvest@progdigy.com>
//- Licence: MPL1.1
//- Date: 15/04/2009
//- Version: 1.1
Reading archive:Extract to path: with CreateInArchive(CLSID_CFormatZip) do
begin
OpenFile('c:\test.zip');
ExtractTo('c:\test');
end;
Get file list: with CreateInArchive(CLSID_CFormat7z) do
begin
OpenFile('c:\test.7z');
for i := 0 to NumberOfItems - 1 do
if not ItemIsFolder[i] then
Writeln(ItemPath[i]);
end;
Extract to stream with CreateInArchive(CLSID_CFormat7z) do
begin
OpenFile('c:\test.7z');
for i := 0 to NumberOfItems - 1 do
if not ItemIsFolder[i] then
ExtractItem(i, stream, false);
end;
Extract "n" Itemsfunction GetStreamCallBack(sender: Pointer; index: Cardinal;
var outStream: ISequentialOutStream): HRESULT; stdcall;
begin
case index of ...
outStream := T7zStream.Create(aStream, soReference);
Result := S_OK;
end;
procedure TMainForm.ExtractClick(Sender: TObject);
var
i: integer;
items: array[0..2] of Cardinal;
begin
with CreateInArchive(CLSID_CFormat7z) do
begin
OpenFile('c:\test.7z');
// items must be sorted by index!
items[0] := 0;
items[1] := 1;
items[2] := 2;
ExtractItems(@items, Length(items), false, nil, GetStreamCallBack);
end;
end;
Open stream with CreateInArchive(CLSID_CFormatZip) do
begin
OpenStream(T7zStream.Create(TFileStream.Create('c:\test.zip', fmOpenRead), soOwned));
OpenStream(aStream, soReference);
...
end;
Progress bar function ProgressCallback(sender: Pointer; total: boolean; value: int64): HRESULT; stdcall;
begin
if total then
Mainform.ProgressBar.Max := value else
Mainform.ProgressBar.Position := value;
Result := S_OK;
end;
procedure TMainForm.ExtractClick(Sender: TObject);
begin
with CreateInArchive(CLSID_CFormatZip) do
begin
OpenFile('c:\test.zip');
SetProgressCallback(nil, ProgressCallback);
...
end;
end;
Password function PasswordCallback(sender: Pointer; var password: WideString): HRESULT; stdcall;
begin
// call a dialog box ...
password := 'password';
Result := S_OK;
end;
procedure TMainForm.ExtractClick(Sender: TObject);
begin
with CreateInArchive(CLSID_CFormatZip) do
begin
// using callback
SetPasswordCallback(nil, PasswordCallback);
// or setting password directly
SetPassword('password');
OpenFile('c:\test.zip');
...
end;
end;
Writing archive procedure TMainForm.ExtractAllClick(Sender: TObject);
var
Arch: I7zOutArchive;
begin
Arch := CreateOutArchive(CLSID_CFormat7z);
// add a file
Arch.AddFile('c:\test.bin', 'folder\test.bin');
// add files using willcards and recursive search
Arch.AddFiles('c:\test', 'folder', '*.pas;*.dfm', true);
// add a stream
Arch.AddStream(aStream, soReference, faArchive, CurrentFileTime, CurrentFileTime, 'folder\test.bin', false, false);
// compression level
SetCompressionLevel(Arch, 5);
// compression method if <> LZMA
SevenZipSetCompressionMethod(Arch, m7BZip2);
// add a progress bar ...
Arch.SetProgressCallback(...);
// set a password if necessary
Arch.SetPassword('password');
// Save to file
Arch.SaveToFile('c:\test.zip');
// or a stream
Arch.SaveToStream(aStream);
分享到:
相关推荐
易语言源码DLL功能插件动态调用.7z
使用Qt 编译使用Bit7z库接口调用7z.dll、7-Zip.dll解压、压缩。预览常用Zip、ISO9660、Wim、Esd、7z等压缩格式文件的一个案例exe桌面小程序 非源码,详细描述见Qt案例专栏 Qt 5.13.1 MSVC2017 编译器 | X64
.\ico7Zip.exe -d 可以将内置ico替换7z的图标。 .\ico7Zip.exe -i "D:/icp7Zip" 可以将指定文件夹下的对应ico替换7z的图标。
7z.dll 64位下载包
被donet坑了,nuget里更新的dll既然有试用期,有张表数据莫名被删,查时间点,极度怀疑是z.entityframework.extensions的问题,csdn里的太坑,要43个积分,穷人只好找别的地方弄了一个,2个积分拿走不谢
金山词霸中2005中带了一个XdictGrb.dll,其实是一个COM组件,并且实现了一个取词的插件框架。 http://hi.baidu.com/ykhykh/blog/item/8ebecb119214f112b9127ba5.html 教程。
支持outlook点击关闭后最小化的windows系统插件,亲测可用
api-ms-win-crt-runtime-l1-1-0.dll 丢失问题 .7z
QTTabBar_1040,windows文件夹标签化插件,无广告,中文版~ ~~~~~~
1. 在7-Zip的安装文件夹中创建"Formats"子文件夹。...2. 将Asar.64.dll或Asar.32.dll(取决于你的7-Zip版本)复制到“Formats”文件夹。 然后你可以忘掉 asar pack app app.asar asar extract app.asar ./app 命令了
pb用7z压缩和解压文件pb12.5(源码含Demo).zip
nsis7z NSISArray nsisDDE NSISList Nsislog nsisMultiMon nsisOS NSISpcre nsisStartMenu nsisUser NsisXiMoL nsisXML NsMCI NsODBC NsRandom nsRestartExplorer NsSCM NsScreenshot nsWeb Nwizplugin Nxs ...
TSC打印机JS开发所需的TSCActiveX.dll和TSCLIB.dll插件, 适用于32位系统及64位系统, 注册时切记需要管理员cmd权限才能部署成功
使用.netcore5.0框架,支持windows10, 程序免注册调用大漠插件,WinForm调用大漠插件dm.dll。实现找字、找图、截图、打字等功能。
ZPPPlayer.dll插件原意是基于C++封装的rtsp rtp/tcp视频流编解码dll,供Unity3D C#脚本调用,也可用于非rtsp流播放; 目前只有两个接口(播放接口以及获取解压后的图片接口): [DllImport("ZPPPlayer.dll", CharSet ...
wireshark 2.6 dlms插件,wireshark 2.6安装后,将dlms.dll解压到软件目录下\plugins\2.6\espan即可正常使用,支持TCP和UDP格式的dlms报文解析
vscode网易云音乐插件windows 64位版本用于替换electron中的ffmpeg.dll
只测试支持*.7z格式。*.zip测试未通过。其他格式如果您需要请自己测试下。只在win下测试,请他平台请先测试后使用。如果是静态编译,需要再src.pro文件里加上:DEFINES += QLIB7Z_NOLIBzip压缩解压请参见QuaZip:
VC6.0实现获取硬盘序列号及CPUID的DLL源程序.7z
所使用的主要特性,序列化,反序列化和反射,刚学不久如有更好方案请指教,在本贴中直接回复 1.先增加模块,选择DLL路径 2.选择执行方法,Run或者Stop 3.运行 时间控制模块Run是暂停10S