C# ?? ZIP ?????????

Contents
[ Hide Show ]

????? ZIP ?????? 1 ??????????????????????????????

??

Aspose.ZIP API ??ZIP ????????????????? Archive ??????????�????????????????????????????? ZIP ????????????????

?????????????????????????????????????????

???????

??????????? ZIP ?????????????????????? ZIP ????????????????????

 1    string[] archivesPaths = new string[] { "data/first.zip", "data/second.zip" };
 2    Archive[] archives = new Archive[archivesPaths.Length];
 3    using (var merged = new Archive())
 4    {
 5        for (int i = 0; i < archivesPaths.Length; i++)
 6        {
 7            Archive a = new Archive(archivesPaths[i]);
 8            archives[i] = a;
 9            foreach (ArchiveEntry entry in a.Entries)
10                merged.CreateEntry(entry.Name, entry.Open());
11        }
12
13        merged.Save("merged.zip");
14
15        for (int i = 0; i < archivesPaths.Length; i++)
16        {
17            archives[i].Dispose();
18        }
19    }
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.