The form shown above consists of three sections – Create, Open and Extract. In order to understand how to use ZipFile, ZipArchive and ZipArchiveEntry classes you will develop a Windows Forms application as shown below: A ZipArchive typically consists of one or more ZipArchiveEntry instances. The ZipArchiveEntry class represents a single entry from a ZipArchive. The ZipArchive class represents a bundle of files that are compressed using Zip file format. The ZipFile class provides static methods for creating, opening and extracting zip files. Some of the new classes of interest are as follows: In order to use these classes you must refer the following two assemblies:Īdditionally, you will also need to import System.IO.Compression namespace in your C# code files. NET framework 4.5 System.IO.Compression, namespaces get some new classes that allow you to work with Zip files programmatically. This article examines some of these classes. If you find yourself struggling or want to increase your knowledge of C#, consider visiting the TechRepublic Academy! Using these classes you can create new Zip files, open and modify existing Zip files and extract the contents of Zip files via code. NET framework 4.5 introduces some new classes in System.IO.Compression namespace that allows you to do just that. At times you may want to deal with Zip files programmatically. Normally people use some third-party utility to create, open and extract Zip files. Most of us deal with Zip files on a daily basis.
0 Comments
Leave a Reply. |