public class ZipFloClass
{
public void ZipFile(string strFile, string strZip)
{
var len = strFile.Length;
var strlen = strFile[len - 1];
if (strFile[strFile.Length - 1] != Path.DirectorySeparatorChar)
{
strFile += Path.DirectorySeparatorChar;
}
ZipOutputStream outstream = new ZipOutputStream(File.Create(strZip));
outstream.SetLevel(6);
zip(strFile, outstream, strFile);
outstream.Finish();
outstream.Close();
}
public void zip(string strFile, ZipOutputStream outstream, string staticFile)
{
if (strFile[strFile.Length - 1] != Path.DirectorySeparatorChar)
{
strFile += Path.DirectorySeparatorChar;
C#学习笔记(八):替换文件夹和文件名及文件内容,移动到新的文件夹路径,再压缩打包
最新推荐文章于 2021-04-16 19:38:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)