在主程序中调用winrar程序,输入参数
CompressFileName:=Copy(GetToday,5,4)+Copy(TimeStr, 1, 2)+Copy(TimeStr, 4, 2);
if FileExists(AddPathAndName(CompressFilePath,CompressFileName)+'.rar') then
DeleteFile(AddPathAndName(CompressFilePath,CompressFileName)+'.rar');
// showmessage(AddPathAndName(CompressToolPath,'rar')+' a '+AddPathAndName(CompressFilePath,CompressFileName)+' '+
// AddPathAndName(TempPath,'*.dbf'));
if ShellOpenFileEx(AddPathAndName(CompressToolPath,'rar'),' a -ep '+AddPathAndName(CompressFilePath,CompressFileName)+' '+
AddPathAndName(TempPath,'*.dbf')) then Memo.Lines.add('压缩成功!')
else Memo.Lines.add('压缩失败!');