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

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations