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 = ;
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的更多相关文章

  1. Windows API方式直接调用C#的DLL,支持多音字转拼音、Gzip解压缩、公式计算(VBA、C++、VB、Delphi甚至java都可以)

    原始链接 https://www.cnblogs.com/Charltsing/p/DllExport.html 这两年,我在VBA应用方面一直有几大痛点:1.多音字转拼音:2.64位下的GZIP解压 ...

  2. 关于 Delphi 中流的使用(7) 压缩与解压缩(TCompressionStream、TDecompressionStream)

    unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, For ...

  3. 如何在 Delphi 中静态链接 SQLite

    搞了我几个小时,终于成功在 Delphi 中静态链接了 SQLite (v3.5.4),下一步就是研究加密了,呵呵中间其实遇到很多问题,今天累了,就不说了,改天补上 下载测试工程 下面说说方法 1.当 ...

  4. Delphi调试CGI或ISAPI 转

      因为dll文件已驻留内存,可用intrabob进行调试,也可用PWS进行调试,不过要换文件. IntraBob是资深程序员Dr.Bob编写的免费工具软件,用于测试Delphi编写 的CGI/Win ...

  5. delphi关于文件操作集锦

        关于文件操作集锦 取得该快捷方式的指向EXE关键词:快捷方式 LNK unit Unit1; interface usesWindows, Messages, SysUtils, Varian ...

  6. delphi 利用HTTP的POST方法做个在线翻译的小工具 good

    最近做了一个英汉小翻译的东东,用的是VC,ADO + Access访问数据库,单词数据库是从金山打字通2002弄来的.后来想了想,想再加个在线翻译的功能,记得经常使用GOOGLE翻译网站的在线翻译,也 ...

  7. 使用zlib来压缩文件-用delphi描述

    今天用到压缩文件的问题,找了一些网上的资料,后来发现了delphi自身所带的zlib单元,根据例子稍微改变了一些,使它能够符合所有的格式. 使用时,需要Zlib.pas和 Zlibconst.pas两 ...

  8. Delphi XE5的Android开发平台搭建[转]

    Delphi XE5支持Android ARM的开发,可以在Android虚拟机里运行,因此建议将XE5安装在64bit的Windows,内存可以大于3GB Delphi XE5安装光盘中包含了最基本 ...

  9. 用DELPHI 开发压缩、解压、自解压、加密

    引 言:在日常中,我们一定使用过WINZIP.WINRAR这样的出名的压缩软件,就是我们开发软件过程中不免要遇到数据加密.数据压缩的问题!本文中就这一技术问题展开探讨,同时感谢各位网友的技巧,在我每次 ...

随机推荐

  1. #define GPFCON (* (volatile unsigned long * )0x56000050 )

    int a; int *p; p = &a; *p = 0x100; //a=0x100 p = (int *)0x56000050; *p =0x100; *( ( int * ) 0x56 ...

  2. LeetCode OJ:Linked List Cycle II(循环链表II)

    Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note ...

  3. Java.lang包的接口解读

    Java.lang包中提供了八个接口: 1.Appendable 能够被追加 char 序列和值的对象.如果某个类的实例打算接收来自 Formatter的格式化输出,那么该类必须实现 Appendab ...

  4. mcake活动维护常见问题记录【wap端】 ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★

    ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ wap端问题及解决方法 ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ 一.wap端弹窗 .Dialogbg-Select{ background-co ...

  5. 《模式 工程化实现及扩展 (设计模式 C#版)》 - 书摘精要

    (P3) 面向对象的典型原则可以划分为两类 —— “面向类”的和“面向包”的: “面向类”的,包括:SRP —— 单一职责原则:OCP —— 开放封闭原则:LSP —— 里氏替换原则:DIP —— 依 ...

  6. 2017.11.2 Talk to customers for an hour

    yesterday::: Hi Huang, For the better performance of the test the Con 6 should be connected all the ...

  7. Dockerfile 模版

    最近一直在用docker,总结了一个靠谱的模版,分享给大家. From ubuntu:14.04 MAINTAINER pidong.li@genetronhealth.com RUN echo de ...

  8. bzoj 1226 学校食堂Dining

    Written with StackEdit. Description 小\(F\) 的学校在城市的一个偏僻角落,所有学生都只好在学校吃饭.学校有一个食堂,虽然简陋,但食堂大厨总能做出让同学们满意的菜 ...

  9. asp.net core microservices 架构之 分布式自动计算(二)

    一  简介                   上一篇介绍了zookeeper如何进行分布式协调,这次主要讲解quartz使用zookeeper进行分布式计算,因为上一篇只是讲解原理,而这次实际使用, ...

  10. python笔记-5(内置函数)

    一.内置函数 1.abs()--取绝对值函数 print(abs(-0.11)) x=-0.01 y=0.11 print(abs(x),abs(y)) ----------------------- ...