我可以使用 Delphi 创建 Windows XP 的压缩 (Zipped) 文件夹吗?
最佳答案
如果您使用的是 Delphi X2,只需使用 System.Zip 中的 TZipFile:
要压缩文件夹,请使用:
TZipFile.ZipDirectoryContents('ZipFile.zip', 'C:\Zip\this\right\now');
要压缩文件,请使用:
Zip := TZipFile.Create;
try
Zip.Open('ZipFile.zip', zmWrite);
Zip.Add('FileToBeZipped.txt');
Zip.Add('ThisWillBeCompressedAgainForSureAndBecomeSmaller.zip');
finally
Zip.Free;
end
关于delphi - 使用 Delphi 创建压缩(Zipped)文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1082735/