1. Open Visual Studio and create a new website
2. Add dll reference of System.IO.Compression and System.IO.Compression.FileSystem
3. On Button Click event write below code
var folderPath = @"D:\testFolder";
var toZipPath = @"D:\testFolder.zip";
ZipFile.CreateFromDirectory(folderPath, toZipPath);
4.Run project
2. Add dll reference of System.IO.Compression and System.IO.Compression.FileSystem
3. On Button Click event write below code
var folderPath = @"D:\testFolder";
var toZipPath = @"D:\testFolder.zip";
ZipFile.CreateFromDirectory(folderPath, toZipPath);
4.Run project