SOLVED: How to load a ZIP file from a byte[] array in C# using Xceed ZIP.NET

If you want to load a ZIP file in C# using Xceed ZIP.NET from a byte[] array you can do so easily by creating a MemoryStream and from there you create a StreamFile which can be loaded into the ZipArchive class.

using (MemoryStream stream = new MemoryStream(zipData))
{
    AbstractFile zipFile = new StreamFile(stream);
    ZipArchive zip = new ZipArchive(zipFile);
    AbstractFile[] files = zip.GetFiles(true);
}


 While you're here -
Why not check out our Group Policy Audit and Documentation Tool?


Comments

Popular posts from this blog

SOLVED: Exchange Online Management PowerShell Connect-ExchangeOnline bug "A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles"

System error 86 has occurred. The specified network password is not correct.

The security identifier of the "NT SERVICE\WdiServiceHost" account is "S-1-5-80-3139157870-2983391045-3678747466-658725712-1809340420"