[
  {
    "Id": "97061",
    "ThreadId": "29135",
    "Html": "<p dir=ltr style=\"margin-right:0px\">This is not a bug, I am sure, but just my own stupidity: in VB 2005 I am trying to loop through a zip file created elsewhere, and most likely with another archive utility. This works fine for most part, but when I try to test an <br>\r\n     .Item(name).IsDirectory=true <br>\r\nI get an exception thrown telling me I ought to use the &quot;new&quot; keyword - which does not make sense because the archive at that point is already open. My problem is that I need to unzip some files into one location (with or without pathname) and some into another.<br>\r\n<br>\r\nHope someone can help me figure out what I am doing wrong.<br>\r\n<br>\r\nThanks</p>\r\n",
    "PostedDate": "2008-06-05T10:04:47.043-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "97127",
    "ThreadId": "29135",
    "Html": "could be a bug, ya never know! <br>\r\nfor the exception, can you show me more of the code, and all of the error message? \r\n",
    "PostedDate": "2008-06-05T15:03:58.14-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "97153",
    "ThreadId": "29135",
    "Html": "<p>Thanks, Cheeso, but I still think this is my mistake - until you really tell me otherwise. NB: the line in bold is what I mentioned earlier on .Item - in my humble opinion - would be better served if it accepted a numerical value as override - but that's just me..<br>\r\n<br>\r\nThe resulting exception:<br>\r\n<em>Extraction failed: Object reference not set to an instance of an object. (Dr Peter Rorlach)<br>\r\n</em></p>\r\n<p>The code producint the error happens on the bold line - the passed variables have been checked and double-checked and they are correct in their values:<br>\r\n<em>For I = 0 To .EntryFilenames.Count - 1<br>\r\ntmpZipFile = .EntryFilenames(I).ToLower<br>\r\nIf getExt(tmpZipFile) = &quot;sc4lot&quot; Or getExt(tmpZipFile) = &quot;sc4desc&quot; Or getExt(tmpZipFile) = &quot;sc4model&quot; Or getExt(tmpZipFile) = &quot;dat&quot; Then<br>\r\n    .Extract(tmpZipFile, destFolder.Text, True)<br>\r\nElse<br>\r\n    </em><em><strong>zItem = .Item(tmpZipFile)<br>\r\n</strong>    If Not zItem.IsDirectory Then<br>\r\n        .Extract(tmpZipFile, destinationFolder, True)<br>\r\n    End If<br>\r\nEnd If<br>\r\nN = N + 1<br>\r\nIf sProg.Value &lt; sProg.Maximum Then<br>\r\n    sProg.Value = sProg.Value + 1<br>\r\nElse<br>\r\n    sProg.Value = 0<br>\r\nEnd If<br>\r\nNext</em></p>\r\n<p>Thanks for your efforts.<br>\r\n<br>\r\nPeter</p>\r\n",
    "PostedDate": "2008-06-05T17:57:35.64-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "97192",
    "ThreadId": "29135",
    "Html": "<p>did you just try a foreach loop? <br>\r\nit seems you're taking the roundabout way . . .<br>\r\nCould you do something like this? </p>\r\n<pre>         Using zip As ZipFile = ZipFile.Read(ZipFileToExtract)\r\n               Dim e As ZipEntry\r\n               For Each e In zip\r\n                  dim entryName as string\r\n                  entryName = e.Filename\r\n                  If getExt(entryName) = &quot;sc4lot&quot; Or getExt(entryName) = &quot;sc4desc&quot; Or getExt(entryName) = &quot;sc4model&quot; Or getExt(entryName) = &quot;dat&quot; Then\r\n                     e.Extract(destFolder.Text, True)<br>                  Else<br>                    If Not e.IsDirectory Then <br>                       e.Extract(destFolder.Text, True)<br>                    End If\r\n                  End If\r\n               Next\r\n         End Using \r\n</pre>\r\n<p>what your code is doing might yet be a bug, but still it seems an indirect and unnecessarily complex way to manipulate the zip archive. </p>\r\n",
    "PostedDate": "2008-06-05T23:10:16.563-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "97211",
    "ThreadId": "29135",
    "Html": "Thanks Cheeso, <br>\r\n<br>\r\nThat, with a minor change (e has to be renamed and declared outside enclosing blocks) di indeed work - so no bug, just an old man's not-seeing-the-trees-for-the-forrest kind of stupidity..<br>\r\n<br>\r\nThanks again.<br>\r\n<br>\r\nPeter R. \r\n",
    "PostedDate": "2008-06-06T01:25:27.533-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]