Cant find center directry
hi iam getting problem in this code iam new developer i tried all possible combinations but this error is not removing can u plz help me
FileStream fileStream;
ZipFile zipFile;
ZipEntry zipEntry;
ZipOutputStream zipout;
Stream stream;
Bitmap bitmap;
fileStream = new FileStream("D:\\Sunset1.gzip", FileMode.Open, FileAccess.read);
zipFile = new ZipFile(fileStream);//cant find center directry
// zipout = new ZipOutputStream(fileStream);
zipEntry = zipFile.GetEntry(Path.GetFileName("D:\\Sunset2.jpg"));
stream = zipFile.GetInputStream(zipEntry);
bitmap = new Bitmap(stream);
pictureBox1.Image = bitmap;
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Serban Cosmin59 reputationPosted Sep 20, 2009, 1:01 AM EDT
carle lai40 reputationPosted Sep 22, 2009, 11:32 PM EDT
System.IO.MemoryStream ms = new MemoryStream();
using (ZipOutputStream s = new ZipOutputStream(ms))
{
s.SetLevel(9); // 0 - store only to 9 - means best compression
byte[] buffer = new byte[4096];
foreach (string file in filenames)
{
ZipEntry entry = new ZipEntry(file);
entry.DateTime = DateTime.Now;
s.PutNextEntry(entry);
// last file is not added as entry
byte[] ba = GetBlob(13);
s.Write(ba, 0, ba.Length);
}