To zip a file in .net you can use Ionic.Zip dll
Example :-
using Ionic.Zip;
FileInfo fi = New FileInfo(yourFilePath);
Using ZipFile zip = New ZipFile()
{
zip.AddFile(yourFilePath, "");
zip.Save(yourFilePath.Replace(fi.Extension, ".zip"));
}
Click Here to download Ionic.Zip
Example :-
using Ionic.Zip;
FileInfo fi = New FileInfo(yourFilePath);
Using ZipFile zip = New ZipFile()
{
zip.AddFile(yourFilePath, "");
zip.Save(yourFilePath.Replace(fi.Extension, ".zip"));
}
Click Here to download Ionic.Zip
2 comments:
How to unzip a file ?
http://hemantsarraf.blogspot.com/2011/11/how-unzip-zip-file.html
Post a Comment