Please use System.IO.Compression! A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
private static MemoryStream GetClientFile(string file)
{
MemoryStream ms = new MemoryStream();
using (ZipInputStream zip = new ZipInputStream(file))
{
ZipEntry ze = zip.GetNextEntry();
while (!(ze is null))
{
if (ze.FileName.EndsWith("tag to locate entry"))
{
ze.ExtractWithPassword(ms, "password");
return ms;
}
ze = zip.GetNextEntry();
}
}
return ms;
}
When I run this I get:
System.InvalidOperationException: Use Extract() only with ZipFile.
I get no intellisense errors, and per the docs, I think I should be able to do this.
When I run this I get:
System.InvalidOperationException: Use Extract() only with ZipFile.
I get no intellisense errors, and per the docs, I think I should be able to do this.