tags:

views:

265

answers:

1

in C# when using SevenZipSharp, how can I extract a single specific file? (I don't want to extract all the archive).

A: 
public void ExtractFile(
    string fileName,
    Stream stream
)

Does this help ?

nc3b
mm thanks, I tried to do it with FileStream something like this:SevenZipExtractor extractor = new SevenZipExtractor(zipFileLocation, ZIP_PASSWORD);Stream st = new FileStream(zipFileLocation,FileMode.Open); extractor.ExtractFile(0,st);though there isn't any error, I don't see that the file was extracted anyware...How to define its destination (I don't see any function..)?maybe I don't use the right Stream object?
Eyal
The second argument is described as "The stream where the file is to be unpacked." Not sure if this is needed, but are you closing the stream ?
nc3b
you are right.the stream is the target, and I didn't close it.now it works, Thanks!
Eyal