Tuesday, 26 June 2018

How to zip folder using c#

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 

SQL server tricky questions