我需要使用以下内容:
using Microsoft.Deployment.Compression.Zip;
从网上看它说我需要以下参考dll
Microsoft.Deployment.Compression.dll
Microsoft.Deployment.Compression.Zip.dll
但我在 .NET 文件夹中找不到这些。
仅供参考,以下是我打算如何使用它。
// CREATING ZIP FILE BY ADDING LIST OF FILES
ZipInfo zip = new ZipInfo(@"C:\testarchive1.zip");
List<strng> files = new List<string>();
files.Add(@"C:\test1.txt");
files.Add(@"C:\test2.txt");
files.Add(@"C:\test3.txt");
zip.PackFiles(null, files, null);
// CREATING ZIP FILE BY ADDING FOLDER (WITH SUB-FOLDERS) USING MAXIMUM COMPRESSION
zip = new ZipInfo(@"C:\testarchive2.zip");
zip.Pack(@"C:\Test", true, Microsoft.Deployment.Compression.CompressionLevel.Max, null);