Crc32 crc = new Crc32(); ZipOutputStream s = new ZipOutputStream(File.Create(@"C:\Documents and Settings\admin\My Documents\Downloads\Evidence.zip")); s.SetLevel(9); // 0 - store only to 9 - means best compression FileStream fs = File.OpenRead(@"c:\boot.ini"); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string fileNamePath = Convert.ToString(ds.Tables[0].Rows[i]["EvidencePath"]); string fileNmae = Convert.ToString(ds.Tables[0].Rows[i]["EvidenceName"]); ZipEntry entry = new ZipEntry(ZipEntry.CleanName(@fileNmae)); entry.DateTime = DateTime.Now; entry.Comment = "test file"; entry.ZipFileIndex = i + 1; crc.Reset(); crc.Update(buffer); entry.Crc = crc.Value; s.PutNextEntry(entry); s.Write(buffer, 0, buffer.Length); } s.Finish(); s.Close(); fs.Close(); } ShowMessageBox("Downloaded....");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)