ASP.NET - how to create .cab files for html files in visual studio

Asked By balaji m on 16-Nov-11 08:17 AM
hi frds

how to create .cab file for html files in visual studio 

pls help 

dipa ahuja replied to balaji m on 16-Nov-11 08:20 AM
using Microsoft.Deployment.Compression.Cab;
//create a instance of Microsoft.Deployment.Compression.Cab.CabInfo
//which provides file-based operations on the cabinet file
CabInfo cab = new CabInfo(@"C:\");
//create a list with files and add them to a cab file
List<string> filesToArchive = new List<string>() { @"C:\file1"@"C:\file2" };
cab.PackFiles(null, filesToArchive, null);
//add a folder (including subdirectories) to another cab file with a maximum compression level
cab = new CabInfo(@"C:\");
cab.Pack(@"C:\folder"true, Microsoft.Deployment.Compression.CompressionLevel.Max, null);
//unpack a cab file into C:\Unpacked folder
Vimal Sharma replied to balaji m on 16-Nov-11 08:21 AM

Look at this
Kirtan Patel replied to balaji m on 16-Nov-11 08:27 AM
Step 1 :download attached DLL with post -->
Step 2 :Add Reference to that DLL and Add namespace at top
CabLib.Compress i_Compress = new CabLib.Compress();
i_Compress.CompressFolder(@"C:\Web", @"C:\Temp\", "*.htm", true, true, 0);