[
  {
    "Id": "439884",
    "ThreadId": "211797",
    "Html": "<p>There is a way for zip a rar file? when I try it i receive this error: filenotfoundexception</p>\r\n<p>&nbsp;</p>\r\n<p>Thankyou</p>",
    "PostedDate": "2010-05-06T07:47:03.63-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "439913",
    "ThreadId": "211797",
    "Html": "<p>I have found that the problem is the name of the file and not rar type.</p>\r\n<p>The name is &quot;S105_SRT_ESI_A01 (Pianta a +27.60 - )_23-04-2010.rar&quot;</p>\r\n<p>I must set any option for this file?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-06T08:31:30.033-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "439917",
    "ThreadId": "211797",
    "Html": "<p>I don't understand your question, but,...<br>DotNetZip does not read RAR files.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-06T08:36:25.033-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "439925",
    "ThreadId": "211797",
    "Html": "<p>I need to zip a file with this file name: S105_SRT_ESI_A01 (Pianta a +27.60 - )_23-04-2010.rar</p>\r\n<p>When I try aI receive an exception.</p>\r\n<p>There is any otion to set for this type of file name?</p>",
    "PostedDate": "2010-05-06T08:42:07.297-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "439975",
    "ThreadId": "211797",
    "Html": "<p>Show me the code you use, and the full exception ﻿stacktrace.</p>",
    "PostedDate": "2010-05-06T09:53:48.027-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "440232",
    "ThreadId": "211797",
    "Html": "<div style=\"color:black;background-color:white\">\r\n<pre>this is the code: </pre>\r\n<pre>   <span style=\"color:blue\">Private</span> <span style=\"color:blue\">Sub</span> Button1_Click(<span style=\"color:blue\">ByVal</span> sender <span style=\"color:blue\">As</span> System.Object, <span style=\"color:blue\">ByVal</span> e <span style=\"color:blue\">As</span> System.EventArgs) <span style=\"color:blue\">Handles</span> Button1.Click\r\n\r\n\r\n\r\n        <span style=\"color:blue\">Dim</span> curr_path, tmp_path <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span>\r\n        \r\n        curr_path = Directory.GetCurrentDirectory()\r\n        tmp_path = curr_path &amp; <span style=\"color:#a31515\">&quot;\\tmp&quot;</span>\r\n\r\n        <span style=\"color:blue\">If</span> Dir(tmp_path, vbDirectory) = <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span>\r\n            MkDir(tmp_path)\r\n        <span style=\"color:blue\">Else</span>\r\n            Directory.Delete(tmp_path, <span style=\"color:blue\">True</span>)\r\n            MkDir(tmp_path)\r\n        <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n\r\n\r\n        <span style=\"color:blue\">Dim</span> file_Target <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span> = tmp_path &amp; <span style=\"color:#a31515\">&quot;\\allegati.zip&quot;</span>\r\n\r\n\r\n        <span style=\"color:blue\">If</span> File.Exists(file_Target) <span style=\"color:blue\">Then</span>\r\n            <span style=\"color:blue\">If</span> (MessageBox.Show(<span style=\"color:blue\">String</span>.Format(<span style=\"color:#a31515\">&quot;The file you have specified ({0}) already exists.  Do you want to overwrite this file?&quot;</span>, _\r\n                                              file_Target), <span style=\"color:#a31515\">&quot;Confirmation is Required&quot;</span>, _\r\n                                              MessageBoxButtons.YesNo, MessageBoxIcon.Question) &lt;&gt; DialogResult.Yes) <span style=\"color:blue\">Then</span>\r\n                <span style=\"color:blue\">Return</span>\r\n            <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n            File.Delete(file_Target)\r\n        <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n        <span style=\"color:blue\">Me</span>._saveCanceled = <span style=\"color:blue\">False</span>\r\n        <span style=\"color:blue\">Me</span>._nFilesCompleted = 0\r\n        <span style=\"color:blue\">Me</span>._totalBytesAfterCompress = 0\r\n        <span style=\"color:blue\">Me</span>._totalBytesBeforeCompress = 0\r\n\r\n        <span style=\"color:green\">' Start Outlook.  </span>\r\n        <span style=\"color:green\">' If it is already running, you'll use the same instance...    </span>\r\n        <span style=\"color:blue\">Dim</span> olApp <span style=\"color:blue\">As</span> Outlook.Application\r\n        olApp = CreateObject(<span style=\"color:#a31515\">&quot;Outlook.Application&quot;</span>)\r\n\r\n        <span style=\"color:green\">' Logon. Doesn't hurt if you are already running and logged on...    </span>\r\n        <span style=\"color:blue\">Dim</span> olNs <span style=\"color:blue\">As</span> Outlook.<span style=\"color:blue\">NameSpace</span>\r\n        olNs = olApp.GetNamespace(<span style=\"color:#a31515\">&quot;MAPI&quot;</span>)\r\n        olNs.Logon()\r\n\r\n        <span style=\"color:blue\">Dim</span> objOutlk\r\n        <span style=\"color:blue\">Dim</span> objMail\r\n\r\n        <span style=\"color:blue\">Dim</span> str_Attach <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span>\r\n        <span style=\"color:blue\">Dim</span> cont_mail <span style=\"color:blue\">As</span> <span style=\"color:blue\">Integer</span> = 1\r\n        <span style=\"color:green\">'Create a new message </span>\r\n        <span style=\"color:green\">'Dim fileDetail As IO.FileInfo</span>\r\n        str_Attach = <span style=\"color:#a31515\">&quot;&quot;</span>\r\n        <span style=\"color:blue\">If</span> ListBox1.Items.<span style=\"color:blue\">Count</span> &gt; 0 <span style=\"color:blue\">Then</span>\r\n\r\n            <span style=\"color:blue\">If</span> CheckBox1.Checked = <span style=\"color:blue\">False</span> <span style=\"color:blue\">Then</span>\r\n\r\n\r\n\r\n                <span style=\"color:blue\">For</span> <span style=\"color:blue\">Each</span> O <span style=\"color:blue\">As</span> <span style=\"color:blue\">Object</span> <span style=\"color:blue\">In</span> ListBox1.Items\r\n                    objOutlk = CreateObject(<span style=\"color:#a31515\">&quot;Outlook.Application&quot;</span>)\r\n                    objMail = objOutlk.createitem(0)\r\n                    <span style=\"color:blue\">If</span> Text_A.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.<span style=\"color:blue\">To</span> = Text_A.Text\r\n                    <span style=\"color:blue\">If</span> Text_cc.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.cc = Text_cc.Text\r\n                    <span style=\"color:blue\">If</span> Text_ccn.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.bcc = Text_ccn.Text\r\n\r\n                    <span style=\"color:blue\">If</span> Text_oggetto.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.subject = Text_oggetto.Text &amp; <span style=\"color:#a31515\">&quot; - &quot;</span> &amp; cont_mail &amp; <span style=\"color:#a31515\">&quot;/&quot;</span> &amp; ListBox1.Items.<span style=\"color:blue\">Count</span>\r\n\r\n                    <span style=\"color:blue\">If</span> cont_mail &gt; 1 <span style=\"color:blue\">Then</span>\r\n                        objMail.body = Text_oggetto.Text &amp; <span style=\"color:#a31515\">&quot; - &quot;</span> &amp; cont_mail &amp; <span style=\"color:#a31515\">&quot;/&quot;</span> &amp; ListBox1.Items.<span style=\"color:blue\">Count</span>\r\n                    <span style=\"color:blue\">Else</span>\r\n                        objMail.body = Rich_mess.Text\r\n                    <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n\r\n                    str_Attach = O\r\n                    objMail.attachments.add(str_Attach)\r\n                    objMail.display()\r\n                    cont_mail = cont_mail + 1\r\n                <span style=\"color:blue\">Next</span>\r\n            <span style=\"color:blue\">Else</span> <span style=\"color:green\">' spitta i file</span>\r\n\r\n                cont_mail = 1\r\n                <span style=\"color:blue\">Dim</span> zip1 <span style=\"color:blue\">As</span> ZipFile = <span style=\"color:blue\">New</span> ZipFile\r\n\r\n                <span style=\"color:blue\">For</span> <span style=\"color:blue\">Each</span> O <span style=\"color:blue\">As</span> <span style=\"color:blue\">Object</span> <span style=\"color:blue\">In</span> ListBox1.Items\r\n                    ProgressBar1.Maximum = ListBox1.Items.<span style=\"color:blue\">Count</span>\r\n\r\n\r\n\r\n                    <span style=\"color:blue\">If</span> File.Exists(O) <span style=\"color:blue\">Then</span> zip1.AddFile(O, <span style=\"color:#a31515\">&quot;Files&quot;</span>)\r\n                    <span style=\"color:blue\">If</span> Directory.Exists(O) <span style=\"color:blue\">Then</span> zip1.AddDirectory(O, <span style=\"color:#a31515\">&quot;Files&quot;</span>)\r\n\r\n                    ProgressBar1.Value += 1\r\n\r\n                <span style=\"color:blue\">Next</span>\r\n\r\n                zip1.MaxOutputSegmentSize() = Val(tx_splitsize.Text) * 1024 * 1024\r\n\r\n                zip1.Save(file_Target)\r\n\r\n                <span style=\"color:blue\">Dim</span> a() <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span>\r\n                a = Directory.GetFiles(tmp_path)\r\n\r\n\r\n                <span style=\"color:blue\">Dim</span> sortQuery = <span style=\"color:blue\">From</span> word <span style=\"color:blue\">In</span> a <span style=\"color:blue\">Order</span> <span style=\"color:blue\">By</span> word.Substring(word.Length - 3, 3) <span style=\"color:blue\">Select</span> word\r\n\r\n\r\n                <span style=\"color:blue\">For</span> <span style=\"color:blue\">Each</span> aa <span style=\"color:blue\">As</span> <span style=\"color:blue\">Object</span> <span style=\"color:blue\">In</span> sortQuery\r\n\r\n                    objOutlk = CreateObject(<span style=\"color:#a31515\">&quot;Outlook.Application&quot;</span>)\r\n                    objMail = objOutlk.createitem(0)\r\n                    <span style=\"color:blue\">If</span> Text_A.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.<span style=\"color:blue\">To</span> = Text_A.Text\r\n                    <span style=\"color:blue\">If</span> Text_cc.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.cc = Text_cc.Text\r\n                    <span style=\"color:blue\">If</span> Text_ccn.Text &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span> objMail.bcc = Text_ccn.Text\r\n\r\n                    <span style=\"color:green\">'If Text_oggetto.Text &lt;&gt; &quot;&quot; Then objMail.subject = Text_oggetto.Text &amp; &quot; - &quot; &amp; cont_mail + 1 &amp; &quot;/&quot; &amp; a.Count '+ 1</span>\r\n                    objMail.subject = Text_oggetto.Text &amp; <span style=\"color:#a31515\">&quot; - &quot;</span> &amp; cont_mail &amp; <span style=\"color:#a31515\">&quot;/&quot;</span> &amp; a.<span style=\"color:blue\">Count</span> <span style=\"color:green\">'+ 1</span>\r\n                    <span style=\"color:blue\">If</span> cont_mail &gt; 1 <span style=\"color:blue\">Then</span>\r\n                        objMail.body = Text_oggetto.Text &amp; <span style=\"color:#a31515\">&quot; - &quot;</span> &amp; cont_mail &amp; <span style=\"color:#a31515\">&quot;/&quot;</span> &amp; a.<span style=\"color:blue\">Count</span> <span style=\"color:green\">'+ 1</span>\r\n                    <span style=\"color:blue\">Else</span>\r\n                        objMail.body = Rich_mess.Text\r\n                    <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n\r\n\r\n                    str_Attach = aa\r\n\r\n                    objMail.attachments.add(str_Attach)\r\n                    objMail.display()\r\n                    cont_mail = cont_mail + 1\r\n\r\n                <span style=\"color:blue\">Next</span>\r\n            <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n            <span style=\"color:green\">'Next</span>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n            <span style=\"color:green\">'End If</span>\r\n\r\n        <span style=\"color:blue\">Else</span>\r\n\r\n            MsgBox(<span style=\"color:#a31515\">&quot;Devi allegare almeno un file&quot;</span>)\r\n\r\n\r\n     <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n\r\n        <span style=\"color:blue\">If</span> Dir(tmp_path, vbDirectory) &lt;&gt; <span style=\"color:#a31515\">&quot;&quot;</span> <span style=\"color:blue\">Then</span>\r\n            Directory.Delete(tmp_path, <span style=\"color:blue\">True</span>)\r\n\r\n        <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n        ProgressBar1.Value = 0\r\n        <span style=\"color:green\">'Clean up </span>\r\n        objMail = <span style=\"color:blue\">Nothing</span>\r\n        objOutlk = <span style=\"color:blue\">Nothing</span>\r\n    <span style=\"color:blue\">End</span> <span style=\"color:blue\">Sub</span></pre>\r\n<pre></pre>\r\n<pre><span style=\"color:blue\">exception</span></pre>\r\n</div>\r\n<p>System.IO.FileNotFoundException non &egrave; stata gestita<br>&nbsp; FileName=&quot;D:\\Visual basic\\Automatic_Mail\\Automatic_Mail\\bin\\Release\\tmp\\allegati.z01&quot;<br>&nbsp; Message=&quot;Impossibile trovare il file 'D:\\Visual basic\\Automatic_Mail\\Automatic_Mail\\bin\\Release\\tmp\\allegati.z01'.&quot;<br>&nbsp; Source=&quot;mscorlib&quot;<br>&nbsp; StackTrace:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.IO.File.Move(String sourceFileName, String destFileName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Ionic.Zip.ZipSegmentedStream.TruncateBackward(UInt32 diskNumber, Int64 offset)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Ionic.Zip.ZipEntry.Write(Stream s)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Ionic.Zip.ZipFile.Save()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Ionic.Zip.ZipFile.Save(String fileName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Automatic_Mail.Form1.Button1_Click(Object sender, EventArgs e) in D:\\Visual basic\\Automatic_Mail\\Automatic_Mail\\Form1.vb:riga 136<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Control.OnClick(EventArgs e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Control.WndProc(Message&amp; m)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Button.WndProc(Message&amp; m)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Automatic_Mail.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in System.Threading.ThreadHelper.ThreadStart()<br>&nbsp; InnerException:</p>\r\n<p>&nbsp;</p>\r\n<div id=\"_mcePaste\" style=\"width:1px;height:1px;overflow:hidden;top:0px;left:-10000px\">﻿</div>",
    "PostedDate": "2010-05-07T00:23:16.613-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "440355",
    "ThreadId": "211797",
    "Html": "<p>The problem you're having is related to the segmentation of the archive.</p>\r\n<p>I don't know why it would fail.</p>\r\n<p>First, what version of DotNetZip are you using?</p>\r\n<p>Second, you need to employ a &quot;Using&quot; clause.&nbsp; See any of the examples for how.&nbsp; See the documentation for reasons why. &nbsp;Don't skip the using clause.</p>\r\n<p>Try that and tell me if it continues to fail.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-07T07:35:59.807-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]