在C#中利用SharpZipLib进行文件的压缩和解压缩
日期:2007年4月28日 作者:-
System.IO.FileStream ZipFile = System.IO.File.Create(ZipedFile);
ZipOutputStream ZipStream = new ZipOutputStream(ZipFile);
ZipEntry ZipEntry = new ZipEntry("ZippedFile");
ZipStream.PutNextEntry(ZipEntry);
ZipStream.SetLevel(CompressionLevel);
byte[] buffer = new byte[BlockSize];
System.Int32 size =StreamToZip.Read(buffer,0,buffer.Length);
ZipStream.Write(buffer,0,size);
try
{
while (size < StreamToZip.Length)
{
int sizeRead =StreamToZip.Read(buffer,0,buffer.Length);
ZipStream.Write(buffer,0,sizeRead);
size += sizeRead;
}
}
catch(System.Exception ex)
{
throw ex;
}
ZipStream.Finish();
ZipStream.Close();
StreamToZip.Close();
}
public void ZipFileMain(string[] args)
{
string[] filenames = Directory.GetFiles(args[0]);
Crc32 crc = new Crc32();
ZipOutputStream s = new ZipOutputStream(File.Create(args[1])); - 上一页 [1] [2] [3] [4] [5] [6] 下一页
-
- 在C#中利用SharpZipLib进行文件的压缩和解压缩 相关文章:
- ·如何进行局域网设置
- ·利用JMF进行多媒体编程
- ·Windows7库运用 技巧:把文件收藏起来
- ·如何用Win XP自带“磁盘管理”进行分区操作
- ·恢复exe文件打开方式,所有exe文件无法打开
- ·揭秘Win7 Vista下WinSXS超大文件夹
- ·dinput8 - dinput8.dll - DLL文件信息
- ·MKV文件无法用暴风影音打开
- 在C#中利用SharpZipLib进行文件的压缩和解压缩 相关软件
- ·超酷浏览器 1.0.01 免费的DWG文件浏览器
- ·文件夹嗅探器 3.51超强的文件夹反加密软件
- ·csf文件播放器 V5.0.0 1118
- ·文件夹万能解密器 V8.5
- ·软件破解入门教程和解密手册
- ·恢复误删除的文件 Undelete PlusV2.93 简体中文版
- ·MP3压缩大师 全能音频转换+音乐减肥版 5.0
- ·Softscape PC Tools(删除顽固文件的好工具) V2.01
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
上一篇:怕BT伤硬盘的进来看看
下一篇:C#就是Java只不过差了一点点
