title: Create and download zip file in c#
body: <p>In my c# app I am trying to create a zip file from the attachments I got from the user and then download the zip file. First I tried using SharpZipLib but it did not work. </p>
  
  <p>I was getting the following error:</p>
  
  <blockquote>
    <p>Thread abort error.</p>
  </blockquote>
  
  <p>Now I am trying to use</p>
  
  <blockquote>
    <p>System.IO.Compression;</p>
  </blockquote>
  
  <p>but something is wrong there, as I am getting this error:</p>
  
  <pre><code>The type or namespace name 'ZipFile' could not be found (are you missing a using directive or an assembly reference?)
  </code></pre>
  
  <p>I have added the dll reference now when I try to do</p>
  
  <pre><code>            using (ZipFile zip = new ZipFile())
              {
                  zip.CompressionLevel = CompressionLevel.Fastest;
  
                  zip.AddSelectedFiles(logoimage, "", false);
                  zip.Save(HttpContext.Current.Response.OutputStream);
              }
  </code></pre>
  
  <p>I get this error,</p>
  
  <pre><code>Cannot declare a variable of static type 'System.IO.Compression.ZipFile'    
  </code></pre>
  
  <p>Any thoughts?</p>