title: Zip and unzip files
body: <p>I am a programmer using VS2012. I am wanting to unzip a zip file (made with Winzip, filzip or other zip compression routines) and then also be able to zip the files back up into a zip file.</p>
  
  <p>What is the best library to use for this and can I please have some sample code on how to use the library?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am using VB.net, here is my code:</p>
  
  <pre><code>Public Function extractZipArchive() As Boolean
      Dim zipPath As String = "c:\example\start.zip"
      Dim extractPath As String = "c:\example\extract"
  
      Using archive As ZipArchive = ZipFile.OpenRead(zipPath)
          For Each entry As ZipArchiveEntry In archive.Entries
              If entry.FullName.EndsWith(".txt", StringComparison.OrdinalIgnoreCase) Then
                  entry.ExtractToFile(Path.Combine(extractPath, entry.FullName))
              End If
          Next
      End Using
  End Function
  </code></pre>
  
  <p>What import statements do I need to use?
  Currently I have added the following:</p>
  
  <pre><code>Imports System.IO
  Imports System.IO.Compression
  </code></pre>
  
  <p>I am getting the error:</p>
  
  <blockquote>
    <p>Type 'ZipArchive' is not defined</p>
  </blockquote>
  
  <p>How can I fix this error?</p>