Some times it may be possible you require to make zip of a file or directory.
so here is simple example.
To start it you have to download “SevenZipSharp.dll”, “7z.dll” you can download sdk from http://www.7-zip.org/sdk.html
Once you download sdk copy above 2 DLL in your project bin folder.
Now write below code which i am writing here
Now let me describe the code to you.
This is function which compress the folder to 7zip what ever pass as a paramter
in this function we have created a sevenzip compressor object
in the above line we set the DLLpath which is basically your bin folder path
sz.CompressionLevel = CompressionLevel.Ultra; is compress level which can be different according to your need.
sz.CompressDirectory(backupFolder, BackupPath + "\\" + DateTime.Now.Date.ToString("yyyyMMddHHmmss") + "_7Zip.7z");
above row compress the directory of backupfolder and rename with datetime_7zip.7z
I hope this will help you.
Thanks & Best Regards,