Search code examples
c#zipextract7zip

How to extract a single file from a 7-ZIP archive in C#?


I Have a 7-Zip file that contains many files inside. How can I extract one special file inside without extracting the whole archive?

Is it possible to list all the files and choose one to get in C#?


Solution

  • You first off all must use 7-zip stand alone console. this post can help you.

    then in console you can filter files by using filters section

    7za.exe x archive.zip -o outputdir *.xml *.pdb *.exe *.ocx *.dll -r
    

    or simple 7za.exe x archive.zip -o outputdir a.xml -r