C1Zip Task-Based Help > Reading a Zipped File Using a StreamReader |
To read a zipped file using a StreamReader, add the following code.
Make sure to add these using statements at the top of the code:
C# |
Copy Code
|
---|---|
using C1.C1Zip; using Microsoft.Win32; using System.IO; |
C# |
Copy Code
|
---|---|
// Open a zip file. C1ZipFile zip = new C1ZipFile(); zip.Open(@"c:\temp\myzipfile.zip"); // Open an input stream on any entry. C1ZipEntry ze = zip.Entries["someFile.cs"]; Stream s = ze.OpenReader(); // Open the StreamReader on the stream. StreamReader sr = new StreamReader(s); // Use the StreamReader, then close it. |