[
  {
    "Id": "102892",
    "ThreadId": "30935",
    "Html": "Hi,<br>\r\n<br>\r\nFirst of all I would like to thank you for the wonderful utility you have created ! Keep the great work going !<br>\r\n<br>\r\nI was wondering if there is a way to zip a file without the directory structure of that file. Basically, when I zip the file c:\\test1\\test2\\file1.doc, and then unzip it to say D:\\test3, it creates the following directory structure D:\\test3\\test1\\test2, and extracts it there. <br>\r\nHere is the code I am using<br>\r\n<br>\r\nZip<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ZipFile file = new ZipFile();<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file.Password = &quot;password&quot;;<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file.AddFile(&quot;file1.doc&quot;);<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file.Save(&quot;test.zip&quot;);<br>\r\nUnzip<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ZipFile file = new ZipFile(&quot;test.zip&quot;);<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file[file.EntryFilenames[0]].ExtractWithPassword(&quot;password&quot;);<br>\r\n<br>\r\nMany thanks !<br>\r\nSameer<br>\r\n<br>\r\np.s. I am using release 1.5<br>\r\n",
    "PostedDate": "2008-07-05T19:53:35.643-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "102893",
    "ThreadId": "30935",
    "Html": "Just realized I need to set the second argument to AddFile as &quot;&quot;.<br>\r\nfile.AddFile(&quot;file1.doc&quot;,&quot;&quot;);<br>\r\n<br>\r\nThis solves my problem.<br>\r\n",
    "PostedDate": "2008-07-05T19:55:00.21-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "102935",
    "ThreadId": "30935",
    "Html": "<p>Yes, you found the answer.&nbsp; I'm glad DotNetZip is working for you. </p>\r\n<p>Just a reminder - DotNetZip is donationware.&nbsp; If you like it, <a href=\"http://cheeso.members.winisp.net/DotNetZipDonate.aspx\">consider donating</a>. Completely voluntary. </p>\r\n",
    "PostedDate": "2008-07-06T09:06:53.417-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]