Delphi 解压缩 ZipForge
ZipForge
http://www.componentace.com/zip_component_zip_delphi_zipforge.htm
downLoad
http://www.componentace.com/download/download.php?editionid=12
Example
http://www.componentace.com/zip-delphi.htm
c++builder、Delphi 压缩文件
ZipForge is a fast and powerful VCL Zip component, written in Delphi.
It lets you easily create ZIP archives, extract files from zip files to hard drive or memory, add files to a zip archive from disk or memory, replace, move and delete files in zip archives. Also it creates and reads self-extracting (SFX) zip archives, AES encrypted and multi-volume zip files.
ZipForge main features:
- Opens and creates archives encrypted with strong AES encryption algorithm
- Zip64 supports - lets you create ZIP files over 4 GB
- Unicode file names support
- Includes transaction system which allows you to rollback changes if archive update failed
- Adds compressed data directly from streams and extracts archived files to streams without creating temp files
- Lets you store full path with drive for each file
- Allows to search for files inside archive by mask
- Progress indication
- Full Delphi source code is available
zf: TZipForge; zf := TZipForge.Create(nil); zf.OpenArchive(aInStream, False); zf.ExtractToStream(FileName, StreamOut);
setup Path
D:\Program Files (x86)\ComponentAce\ZipForge
压缩文件
void __fastcall TForm4::Button1Click( TObject * Sender ) {TMemoryStream * ms = new TMemoryStream( );Memo1->Text="Hello Word!";Memo1->Lines->SaveToStream( ms );ZipForge1->FileName = "a.zip";//压缩包的名称ZipForge1->OpenArchive( ); ZipForge1->AddFromStream( "a.txt", ms, true );//压缩包里的文件//ZipForge1->AddFromString("b.txt","text2",)ZipForge1->CloseArchive( );delete ms;}
解压缩
void __fastcall TForm4::Button2Click( TObject * Sender ) {TMemoryStream * ms = new TMemoryStream( );ZipForge1->FileName = "a.zip";//压缩包名称ZipForge1->OpenArchive( );ZipForge1->ExtractToStream( "a.txt", ms );//压缩包里的文件ms->Position = 0;Memo1->Lines->LoadFromStream( ms );// To String // String StrOut; // ZipForge1->ExtractToString( "a.txt", StrOut );ZipForge1->CloseArchive( );delete ms; }
解压缩到字符串
void __fastcall TForm4::Button2Click( TObject * Sender )
{
ZipForge1->FileName = "a.zip";
ZipForge1->OpenArchive( );
// To String
String StrOut;
ZipForge1->ExtractToString( "a.txt", StrOut );
Memo1->Text = StrOut;
ZipForge1->CloseArchive( );
}
查找压缩包文件列表,找到文件名称,然后
ZipForge1->ExtractToStream(文件名,stream);
Use FindFirst and FindNext methods of TZipForgefor searching files within the archive file.
获得压缩包中的文件列表
TZFArchiveItem afItem;bool aFound = ZipForge1->FindFirst( "*.*", afItem, faAnyFile, "" );while ( aFound ){this->mmoFileList->Lines->Add( afItem.FileName );aFound = ZipForge1->FindNext( afItem );}
压缩包文件详情
this->mmoFileList->Lines->Add( afItem.FileName );this->mmoFileList->Lines->Add( ">>>>" );this->mmoFileList->Lines->Add( afItem.StoredPath );this->mmoFileList->Lines->Add( afItem.CompressedSize );//压缩后文件大小this->mmoFileList->Lines->Add( afItem.UncompressedSize );//压缩前文件大小this->mmoFileList->Lines->Add( afItem.CompressionRate );this->mmoFileList->Lines->Add((int) afItem.Encrypted );this->mmoFileList->Lines->Add( afItem.LastModFileDate );this->mmoFileList->Lines->Add( afItem.LastModFileTime );this->mmoFileList->Lines->Add( afItem.CRC );this->mmoFileList->Lines->Add( afItem.ExternalFileAttributes );this->mmoFileList->Lines->Add( afItem.Comment );
从流中解压
TMemoryStream * ms;ms = new TMemoryStream( );ms->LoadFromFile( "a.zip" );ZipForge1->OpenArchive( ms, false );
.Net c#
ICSharpCode.SharpZipLib.dll
ZipOutputStream
http://icsharpcode.github.io/SharpZipLib/
Delphi 解压缩 ZipForge相关推荐
- Delphi中的字符串压缩与解压缩
在Delphi中如果需要对字符串进行压缩与解压缩是非常简单的事,只需要uses一下zlib单元即可. ZCompressStr:压缩字符串,传人字符串,返回TBytes; ZDecompressStr ...
- 关于 Delphi 中流的使用(10): 压缩与解压缩进度 - 回复 ilst 的问题
为什么80%的码农都做不了架构师?>>> 问题来源: http://www.cnblogs.com/del/archive/2008/08/02/1022539.html#12 ...
- 自己对Delphi中使用正则表达式的研究心得
在 Delphi 中使用正则表达式, 目前 PerlRegEx 应该是首选, 在此分享一下自己的一些心得体会. 官方网站: http://www.regular-expressions.info/de ...
- Delphi使用CEF4Delphi制作Chromium谷歌内核浏览器
什么是CEF4Delphi? CEF4Delphi是由Salvador Díaz Fau创建的一个开源项目,用于在基于Delphi或Lazarus/FPC的应用程序中嵌入基于谷歌内核 查看更多关于 内 ...
- Delphi编程中流的使用
什么是流?流,简单来说就是建立在面向对象基础上的一种抽象的处理数据的工具.在流中,定义了一些处理数据的基本操作,如读取数据,写入数据等,程序员是对流进行所有操作的,而不用关心流的另一头数据的真正流向. ...
- 结合Delphi和Python的优势:使用Delphi VCL组件快速构建超现代的Python本机Windows GUI桌面酷炫用户界面应用
Delphi开发Pyhron GUI 有时您的应用程序需要一个用户界面,但是为Python应用程序制作用户界面最好的方法是什么?输入用于Python的DelphiVCL.VCL是成熟的Windows本 ...
- 《Delphi传奇》网络游戏组件安装步骤:Delphi 10.3安装DelphiX
1.官网下载最新版本DelphiX游戏开发组件:http://www.micrel.cz/Dx/ 欢迎加入Delphi开发局QQ群:32422310 2.解压缩到一个文件夹中,建议不要用英文: 3.启 ...
- Delphi使用SpreadSheet
https://wenku.baidu.com/view/c03a6ff50029bd64793e2c3a.html 1.开发环境 以Delphi7为例,使用DevExpress套件中的Express ...
- 用Delphi开发视频聊天软件
一.引言 我们知道视频聊天软件的关键技术在于采集视频,并实时传输给聊天软件在线的人.对于视频的采集,这里采用微软公司的关于数字视频的一个软件包VFW(Video for Windows).相信很多人对 ...
最新文章
- hadoop+spark生态系统操作与指南非影印版_Spark背景知识学习
- 【php复习之】php创建数组的几种方式
- mysql 5.6.31 winx64_详解介绍MySQL5.6.31winx64.zip安装配置的图文教程
- java操作Linux 调用shell命令,shell脚本
- opencv4版本和3版本_Spring Boot 太狠了,一口气发布了 3 个版本!
- .net core 应用程序“default web site”中的服务器错误_Net程序员讲JAVA系列——Spring Boot“科普篇”...
- linux设备数内核选项,linux内核设备树修改指南 / linux kernel device tree modify guide
- 微信小程序实现图片懒加载
- 网易公开课APP如何修改视频缓存地址
- gas费用测试优化:hardhat-gas-reporter
- 使用Bmob云端代码开发微信公众平台教程
- 六足机器人步态与动力学仿真
- 百度、快手、商汤、旷视等重磅嘉宾确认出席AI ProCon 2019,你还剩1天早鸟票特权!...
- 写给男人的十句悄悄话,想知道女人到底想要什么样的男人吗,那么请详读下文——
- CentOS虚拟机连接外网
- 公众号如何发布一个投票活动
- 多线程-Callable接口
- 2022-2027年中国婚纱礼服行业市场全景评估及发展战略规划报告
- 报表软件解决报表需求
- Intellij IDEA插件 CodeGlance 快速定位代码
热门文章
- android wear 运动程序,Android Wear 之 为通知添加动作
- java 表达式2004的值_javaSE习题 第三章 运算符、表达式和语句
- python 封装对象数据_Python数据库封装实现代码示例解析
- python安装失败未指定_windows 7 32bit安装 python3.5.0 安装错误 0x80240017 -未指定错误...
- 截取文件最后10行_10 行 Python 代码自动清理电脑内重复文件,解放双手
- 思必驰十年创业,(现在)是一家怎样的公司?
- 景驰无人车北京子公司上亿资金被冻结!潘思宁夺回法人身份
- 苹果架构调整:AI、机器学习和Siri合并,由前谷歌AI负责人领导
- Linux就该这么学-第三课
- Matplotlib学习笔记1