谁有做过在Delphi中压缩整个目录成一个文件,救急!给100分! 我现在要做服务端控制客户端来接收文件,但是客户端那边是目录,我想把客户端的目录压缩成一个文件,然后通过socket进行传送这个文件到服务端指定目录,但是现在不知道如何压缩目录成一个文件,请各位大侠多多指教,给100分! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 对方有RAR的话,直接调用winrar命令行参考 rar a -o+ c:\11.mdb c:\temp\myback.rar不然用第三方压缩控件VCLZip是不是眼花,还是又有个帖子 补充一下一楼: {--------------压缩----------------------} htys:='d:\tmp_data.rar'; dbpath := 'd:\tmp'; aa:='winrar.exe a -mm -r '+ htys + ' ' + dbpath + '\htys'; if winexec(pchar(aa),1)<=31 then begin messagebox(handle,'压缩操作失败!','提示信息',0); exit; end; {-------------解压缩----------------------} file_name:='d:\htys\tmp_data.rar'; dbpath := 'd:\tmp'; aa:='winrar e -o+ '+file_name+' '+dbpath; if not fileexists(file_name) then begin messagebox(handle,pchar(file_name+'文件不存在,无法进行解压缩操作!'),'提示信息',0); exit; end; if winexec(pchar(aa),sw_hide)<=31 then begin messagebox(handle,'解压缩操作失败!','提示信息',0); exit; end;//VCLZip控件VCLZip1.FilesList.Add('...'); // VCLZip1.ZipName := ... Try VCLZip1.Zip; //压缩文件 Except Application.MessageBox('压缩失败', '错误', MB_OK); End; 怎么老跳出database login 救急。。。delphi 一个关于FastReport3的问题???? imagelist控件中加入的图标要求是多少像素的,我的图标是32*32,加入的的时候提示我太大 ado缓存问题 第一次花100分来提问,求一个智能的copy文件的解决方案. 在MDI中如何使子窗体不显示父窗体的菜单和控件? 谁知道delphi的快捷方式在那个文件下阿?我的xp系统用户坏了,结果delphi的快捷方式不管用了 谁能够提供rxdbgrid或者是dbgrideh用于6.0的? 怎样用DIRECTSOUND 新手在门外,何为Delphi? 顶也给分! 老是报错
winrar命令行参考
rar a -o+ c:\11.mdb c:\temp\myback.rar不然用第三方压缩控件VCLZip是不是眼花,还是又有个帖子
htys:='d:\tmp_data.rar';
dbpath := 'd:\tmp';
aa:='winrar.exe a -mm -r '+ htys + ' ' + dbpath + '\htys';
if winexec(pchar(aa),1)<=31 then
begin
messagebox(handle,'压缩操作失败!','提示信息',0);
exit;
end; {-------------解压缩----------------------}
file_name:='d:\htys\tmp_data.rar';
dbpath := 'd:\tmp';
aa:='winrar e -o+ '+file_name+' '+dbpath;
if not fileexists(file_name) then
begin
messagebox(handle,pchar(file_name+'文件不存在,无法进行解压缩操作!'),'提示信息',0);
exit;
end; if winexec(pchar(aa),sw_hide)<=31 then
begin
messagebox(handle,'解压缩操作失败!','提示信息',0);
exit;
end;
//VCLZip控件VCLZip1.FilesList.Add('...'); //
VCLZip1.ZipName := ...
Try
VCLZip1.Zip; //压缩文件
Except
Application.MessageBox('压缩失败', '错误', MB_OK);
End;