Hi Naresh,
for your particuliar situation, assuming you have a C: drive with a writable \temp folder, the simplest answer is:
namespace _26165_PreservZIPPath
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ZipArchive myZip = new ZipArchive(new DiskFile(@"C:\Temp\AllMyFiles.zip"));
myZip.BeginUpdate();
foreach (DiskFolder df in new DiskFolder(@"A:\B\").GetFolders(false))
{
df.CopyTo(myZip, true);
}
myZip.EndUpdate();
}
}
}
Of course, for more flexibility, you could get the user input, (i.e. the starting point of the hyerarchy of the folders to be zipped), in a textbox, and the destination in another textbox, minimally. And this would have to be activated by a click of a button, of course, splitting the code above so you get the InitiazeComponent() out of event handler code., There are tons of ways to improve the basic solution.
Best regards
Ghislain
Technical Support and software developer
Xceed Software Inc.
Knowledge Base : http://xceed.com/kb/
Update Center : http://xceed.com/updates/
Documentation Center : http://xceed.com/doc/
For everything else, there is Google