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

Asked By balaji mogadali 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 mogadali 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:\Cabinet1.cab");
 
//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:\Cabinet2.cab");
cab.Pack(@"C:\folder"true, Microsoft.Deployment.Compression.CompressionLevel.Max, null);
 
//unpack a cab file into C:\Unpacked folder
cab.Unpack(@"C:\Unpacked");

http://mnarinsky.blogspot.com/2009/11/creating-cab-file-in-c.html
Vimal Sharma replied to balaji mogadali on 16-Nov-11 08:21 AM
http://msdn.microsoft.com/en-us/library/aa291417%28v=vs.71%29.aspx

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