.NET - 将文件添加到子文件夹,然后将该子文件夹添加到rootfolder,然后将根文件夹添加到ZIP

时间:2018-03-27 13:46:55

标签: c# .net zip directory

我有fileNamecontentBytes,应添加到subfolder,然后subfolder应添加到rootfolder,然后rootfolder }应添加到ZIP中。

目前我所拥有的是(zip所在的地方):

using (var zip = ZipHelper.Initialize()) {
   var subfolder= "Prefix" + fileName;
   zip.AddEntry(subfolder, contentBytes);
}

我需要在此结构中再添加一个级别:

- contentBytes into subfolder
- subfolder into rootfolder and then:
- zip.AddEntry(rootfolder , subfolderContent);

0 个答案:

没有答案