I used this:
int x;
for (x = 0; x < zip.Count - 1; x++)
{
ZipEntry e = zip[x];
if (e.FileName == "META-INF/")
{
zip.RemoveEntry(e.FileName);
}
}
题
I need to remove one folder called "META-INF". It contains some files. How can I delete that folder, along with all the files in it, without typing all of their names? I can't extract all the files, delete the directory with all the files, and then pack the zip again, because the zip has many files (~1800).
解决方案
I used this:
int x;
for (x = 0; x < zip.Count - 1; x++)
{
ZipEntry e = zip[x];
if (e.FileName == "META-INF/")
{
zip.RemoveEntry(e.FileName);
}
}
其他提示
You can use something like this:
var matches = fileSelector.SelectEntries(yourZipFile,"META-INF");
for(int i = 0;i < matches.Length; ++i)
{
yourZipFile.RemoveEntry(matches[i].FileName);
}