C#文件压缩
程序员文章站
2022-03-23 19:20:01
using System.IO.Compression; string TOZipPath = String.Format("~/Static/ZIP/{0}", DirName); //需要压缩的源文件 string TOZipFilePath = String.Format("~/Static/ ......
using system.io.compression;
string tozippath = string.format("~/static/zip/{0}", dirname); //需要压缩的源文件
string tozipfilepath = string.format("~/static/zip/{0}", dirname + ".zip"); //压缩成新的zip文件
try
{
zipfile.createfromdirectory(server.mappath(tozippath), server.mappath(tozipfilepath));
}
catch (exception ex){}
上一篇: 复旦大学成功实现用脑电波和手势控制无人机