I have programmatically created a password-protected zip file using DotNetZip in c#. but when I try to unzip using ExtractWithPassword method in DotNetZip, the zip file is not recognized as a zip file. the returned output is a MemoryStream. Is there any alternative zip sdk available to create password-protected zip file and output as a MemoryStream?
MemoryStream NewStream = new ();
try
{
using (ZipFile zip = ZipFile.Read(Zipfile))
{
foreach (var item in zip)
{
item.ExtractWithPassword(NewStream, Password);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
TIA.