Torna al Thread

for (int i = 0; i < listView1.Items.Count; i++) { string sourceFile = listView1.Items[i].Text; statusBar1.Text = sourceFile; java.io.FileInputStream fis = new java.io.FileInputStream(sourceFile); // File name format in zip file is: // folder/subfolder/filename // Let's delete drive name and replace '\' with '/': java.util.zip.ZipEntry ze = new java.util.zip.ZipEntry(sourceFile.Substring(3).Replace('\\','/')); zos.putNextEntry(ze); sbyte[] buffer = new sbyte[1024]; int len; while((len = fis.read(buffer)) >= 0) { zos.write(buffer, 0, len); } zos.closeEntry(); fis.close(); }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5