请问,在Delphi里面将生成的文本文件进行压缩,是用什么方法啊?

liulangnanhai 2004-12-01 09:25:25
如题,多谢啦
...全文
207 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzlingaaa 2004-12-16
  • 打赏
  • 举报
回复
搜索一下,很多答案的
liulang1314521 2004-12-15
  • 打赏
  • 举报
回复
解压的时候有问题吧?
xiyixiaowm50 2004-12-03
  • 打赏
  • 举报
回复
同意楼上
ssq237712 2004-12-02
  • 打赏
  • 举报
回复
引用zlib,不管你什么文件都可以压缩。

function MyZip(InFlName, OutFlName: string): integer;
var
InFile, outfile: TFilestream;
ZStream: TCustomZLibStream;
begin
InFile := TFileStream.Create(InFlName, fmOpenRead);
try
OutFile := TFileStream.Create(OutFlName, fmCreate);
try
ZStream := TCompressionStream.Create(clFastest, OutFile);
try
ZStream.CopyFrom(InFile, 0);
finally
ZStream.Free;
end;
finally
result := outfile.Size;
OutFile.Free;
end;
finally
InFile.Free;
end;
end;

procedure MyUnZip(InFlName, OutFlName: string);
const
buffersize = 4096;
var
InFile: TStream;
OutFile: TStream;
ZStream: TCustomZLibStream;
begin
InFile := TFileStream.Create(InFlName, fmOpenRead);
try
OutFile := TFileStream.Create(OutFlName, fmCreate);
try
ZStream := TDecompressionStream.Create(InFile);
try
OutFile.CopyFrom(ZStream, 0);
finally
ZStream.Free;
end;
finally
OutFile.Free;
end;
finally
InFile.Free;
end;
end;
liulangnanhai 2004-12-02
  • 打赏
  • 举报
回复
就是在Delphi里生成zip文件啊
nyf1220 2004-12-02
  • 打赏
  • 举报
回复
怎么个压缩啊?

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧