[
  {
    "Id": "262476",
    "ThreadId": "76772",
    "Html": "<p>Hi guys,</p>\r\n<p>&nbsp;</p>\r\n<p>Maybe I am doing it wrong but I am getting a could not be read error. Here is the code:</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre><span style=\"color:Blue\">namespace</span> Fontification\r\n{\r\n    <span style=\"color:Blue\">class</span> FontGrabber\r\n    {\r\n        <span style=\"color:Blue\">public</span> <span style=\"color:Blue\">void</span> GrabFont(<span style=\"color:Blue\">string</span> inputPath, <span style=\"color:Blue\">string</span> outputPath)\r\n        {\r\n            <span style=\"color:Green\">//Create a directory in the users temporary folder</span>\r\n            <span style=\"color:Blue\">string</span> tempFolder = Path.GetTempPath();\r\n\r\n            <span style=\"color:Green\">//Create a variable to hold the name of the file</span>\r\n            <span style=\"color:Blue\">string</span> folderName;\r\n\r\n            <span style=\"color:Green\">//Grab The XPS File and remove its contents to a temp directory</span>\r\n            <span style=\"color:Blue\">using</span> (ZipFile XPSFile = ZipFile.Read(inputPath))\r\n            {\r\n                folderName = XPSFile.Name;\r\n                XPSFile.ExtractAll(tempFolder);\r\n            }\r\n\r\n            \r\n        }\r\n        \r\n    }\r\n}\r\n</pre>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>To test this I tried to read a standard Zip file&nbsp; by supplying the full path plus the zip name with .zip at the end. The error happens on the Using section, what am I doing wrong?</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<div id=\"_mcePaste\" style=\"overflow:hidden;left:-10000px;top:285px;width:1px;height:1px\">namespace Fontification<br>{<br>&nbsp;&nbsp;&nbsp; class FontGrabber<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void GrabFont(string inputPath, string outputPath)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Create a directory in the users temporary folder<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string tempFolder = Path.GetTempPath();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Create a variable to hold the name of the file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string folderName;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Grab The XPS File and remove its contents to a temp directory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (ZipFile XPSFile = ZipFile.Read(inputPath))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; folderName = XPSFile.Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XPSFile.ExtractAll(tempFolder);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; }<br>}</div>",
    "PostedDate": "2009-12-01T14:18:28.89-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "262599",
    "ThreadId": "76772",
    "Html": "<p>The exception will give you additional information.&nbsp; It could be that the file does not exist.&nbsp; It could be that the file is not readable.&nbsp; It could be that the file is not a zip file. It could be that it is a corrupt zip file.&nbsp; There may be other reasons. The exception will give you additional information.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-12-01T22:59:59.38-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "262709",
    "ThreadId": "76772",
    "Html": "<p>Ah ok i thought my implementation was wrong. I will check the exeception when i get home. Thanks a mil!</p>\r\n<p><blockquote>On 2 Dec 2009 07:00, &quot;Cheeso&quot; &lt;<a href=\"mailto:notifications@codeplex.com\">notifications@codeplex.com</a>&gt; wrote:<br><br>   <div> <p>From: Cheeso</p> <div><p>The exception will give you additional information.  It could be that the file does not exist.  It could be that the file is not readable.  It could be that the file is not a zip file. It could be that it is a corrupt zip file.  There may be other reasons. The exception will give you additional information.</p>\r\n\r\n<p> </p></div><p>\r\n\r\nRead the full discussion online.\r\n\r\nTo add a post to this discussion, reply to this email (DotNetZip...</p></div> </blockquote></p>",
    "PostedDate": "2009-12-02T05:11:34.69-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]