Perform the following steps:
- Create a console application and call it FilesExample:
- Right-click on the References node and select Add Reference... from the context menu:
- In the Reference Manager, search for the word compression. Add a reference to System.IO.Compression and System.IO.Compression.FileSystem to your project and click on the OK button.
At the time of writing, there was a System.IO.Compression version 4.1.0.0 and System.IO.Compression version 4.0.0.0 available from the Reference Manager. The example I created just used version 4.1.0.0.
- When you have added your references, your solution should look as follows:
- Create a folder called Documents in your temp folder:
- Inside this folder, create a few files of varying sizes:
You are now ready to write some code.