Tuesday 15 February 2011

visual studio 2010 - Sevenzip extractFile(String file, Stream stream) method stream parameter. c# -


I am trying to use a file in a .7z file. I know the name of the file in the ZIP folder and it exists in the .7z file. First I used Extract Arctor (Dump) which dumps all the files in a temporary location. Now I want to capture a specific file without removing the entire .7z file.

7Zip is a class called SevenZipExtractor that is a method ExtractFile. I would have thought what I was looking for, but I can not find any decent document on it.

I need clarification on how to know how to correctly pass the passed stream parameters, I am using code like this;

  // This zip file grabs and creates a FileInfo array that holds the .7z file (the value there is only one) DirectoryInfo DirectoryInfo = new DirectoryInfo (ApplicationPath); Fileinfo [] zipfile = directoryinfogate files ("* .7z"); // This zip file creates zipextractor on I just put in the zipfile FileInfo array (SevenZip.SevenZipExtractor zipExtractor = New SevenZip.SevenZipExtractor (zipfile [0] .FullName)) // Here I am able to use ExtractFile method Should be, although I can not understand the stream parameter, and I can not find any good documents on the method What is the search for this method? {ZipExtractor.ExtractFile ("ConfigurationStore.xml", stream stream); }    

After

Setup a FileStream that SevenZip can write out : directoryInfree directoryInfo = new directoryInfoPath; Fileinfo [] zipfile = directoryinfogate files ("* .7z"); (Using SevenZip.SevenZipExtractor zipExtractor = New SevenZip.SevenZipExtractor (zipfile [0] .FullName)) using empty string (using FileStream FS = new FileStream ("FileMode.Create") // with desired destination Place {zipExtractor.ExtractFile ("ConfigurationStore.exml", FS); }}

No comments:

Post a Comment