compressed-folder

Creating Compressed (Zipped) Folder using Delphi

蹲街弑〆低调 提交于 2019-11-29 08:36:30
问题 Can I create Windows XP's Compressed (Zipped) Folder using Delphi? 回答1: If you are using Delphi X2, just use TZipFile from System.Zip: To Zip a folder, use: TZipFile.ZipDirectoryContents('ZipFile.zip', 'C:\Zip\this\right\now'); To Zip files, use: Zip := TZipFile.Create; try Zip.Open('ZipFile.zip', zmWrite); Zip.Add('FileToBeZipped.txt'); Zip.Add('ThisWillBeCompressedAgainForSureAndBecomeSmaller.zip'); finally Zip.Free; end 回答2: According to a thread in eggheadcafe, you can use CreateFile