?????? ??????? ZIP ? C#
Contents
[
Hide
Show
]???? ?? ?????? ??�?????? ???????? ????????? ZIP-??????? ? ???? ?????, ?????????? ?? ??????.
????
API Aspose.ZIP ????? ????� Archive�??? ??????????? ?? ????????? ZIP-???????.�?? ?????? ??????? ????? ? ???’???, ?? ?????????? ???? ? ?????????? ???????, ? ??????? ???????? ? 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 }