I still have struggled with the following code: It seems it looks okay to me. Please advice.
ICSharpCode.SharpZipLib.Zip.ZipOutputStream oZip = new ICSharpCode.SharpZipLib.Zip.ZipOutputStream(System.IO.File.Create(System.IO.Directory.GetDirectoryRoot(System.IO.Directory.GetCurrentDirectory()) + "PAGE" + this.txtPageNumber.Text.Trim() + ".ZIP"));
oZip.SetLevel(9);
System.IO.FileStream fs = new System.IO.FileStream(System.IO.Directory.GetDirectoryRoot(System.IO.Directory.GetCurrentDirectory()) + "TEST." + System.Drawing.Imaging.ImageFormat.Gif.ToString().ToUpper(), System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite);
byte[ buffer = new Byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
ICSharpCode.SharpZipLib.Zip.ZipEntry oZipEntry = new ICSharpCode.SharpZipLib.Zip.ZipEntry("PAGE" + this.txtPageNumber.Text.Trim() + "." + System.Drawing.Imaging.ImageFormat.Gif.ToString().ToUpper());
oZipEntry.DateTime = System.DateTime.Now;
oZipEntry.Size = fs.Length;
fs.Close();
fs = null;
ICSharpCode.SharpZipLib.Checksums.Crc32 oCrc32 = new ICSharpCode.SharpZipLib.Checksums.Crc32();
oCrc32.Reset();
oCrc32.Update(buffer);
oZipEntry.Crc = oCrc32.Value;
oCrc32 = null;
oZip.PutNextEntry(oZipEntry);
oZip.Write(buffer, 0, buffer.Length);
oZip.Finish();
oZip.Close();
oZip.Dispose();
oZip = null;
oZipEntry = null;
buffer = null;