Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| // <snippet1> | |
| using System; | |
| using System.IO; | |
| using System.IO.Compression; | |
| namespace ConsoleApplication1 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| string zipPath = @"c:\example\start.zip"; | |
| string extractPath = @"c:\example\extract"; | |
| using (ZipArchive archive = ZipFile.OpenRead(zipPath)) | |
| { | |
| foreach (ZipArchiveEntry entry in archive.Entries) | |
| { | |
| if (entry.FullName.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)) | |
| { | |
| entry.ExtractToFile(Path.Combine(extractPath, entry.FullName)); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| // </snippet1> |