在asp.net项目中,我使用活动报告生成发票,然后将其保存为pdf格式。在那里我想动态创建一个zip文件并添加pdf发票然后在客户端下载此文件zip。请帮帮我。
答案 0 :(得分:0)
string zipFileName = "a.zip";
using (var zip = new ZipFile())
{
System.IO.File.Delete(fileDir + "/" + zipFileName);
zip.AddDirectory(fileDir + "/");
zip.CompressionLevel = CompressionLevel.Level5;
zip.CompressionMethod = CompressionMethod.BZip2;
zip.Save(fileDir + "/" + zipFileName);
}