C#压缩代码

来源:百度知道 编辑:UC知道 时间:2024/06/06 05:54:05
如何写, 数据压缩代码? 知道,谢谢

GZipStream compStream =
new GZipStream(destFile, CompressionMode.Compress); //destFile是压缩后的文件
int theByte = sourceFile.ReadByte(); //sourceFile 是待压缩的文件
while (theByte != -1)
{
compStream.WriteByte((byte)theByte);
theByte = sourceFile.ReadByte();
}

悬赏分:0 ?!

内置有类库支持zip.
其他的自己搞