Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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#?

TNX!
Posted
Comments
Sergey Alexandrovich Kryukov 9-Aug-14 22:43pm    
How a file can be "special"? What is it? What's the problem?
—SA
Andreas Gieriet 9-Aug-14 23:24pm    
I assume the OP meant "specific" - that's also a common language trap in German to English translation.
Cheers
Andi
Sergey Alexandrovich Kryukov 9-Aug-14 23:41pm    
Ah, those translation traps... I did not get this one, thank you for explaining it to me.
—SA
Amir Hosein Nasr 10-Aug-14 13:02pm    
exactly
____________
I'm Persian!

You can extract whatever you want. You can use SevenZipSharp, a .NET wrapper of 7-Zip:
http://en.wikipedia.org/wiki/7-Zip[^],
http://sevenzipsharp.codeplex.com/[^].

—SA
 
Share this answer
 
Comments
Andreas Gieriet 9-Aug-14 23:25pm    
My 5!
Cheers
Andi
Sergey Alexandrovich Kryukov 9-Aug-14 23:40pm    
Thank you, Andi.
—SA
Kornfeld Eliyahu Peter 10-Aug-14 3:07am    
Since .NET 4.5 you may use this: http://msdn.microsoft.com/en-us/library/system.io.compression.zipfile(v=vs.110).aspx
But anyway a 5!
Sergey Alexandrovich Kryukov 10-Aug-14 13:25pm    
Thank you Peter, but why do you think that Microsoft System.IO.Compression.ZipFile supports 7-zip archive? 7-zip is a separate compression algorithm.
—SA
Kornfeld Eliyahu Peter 10-Aug-14 14:11pm    
7z is a container format. From OP tags and writing of 7-Zip instead of 7z I understood that he talking about a 7z archive container with zip compression inside, in which case we talking about a LZ77 compressed file...
In addition to solution 1: If you use .NET 4.5 you may use the build in ZipFile[^] class...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900