-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: RohanMandora_2005
Message 1 in Discussion
Hi All, I am working on a sample application in which I need to zip/archive
files in C#. I looked into GZIPStream and found that it compresses only a
single file. I also tried the Shell32 class for zipping. The code for which
is shown below. Using this I am able to compress a folder that has sub-folders
and files but the problem is there is no event which is raised when compression
finishes or error occurs. So I have to wait for some time after this code to
allow Zip to complete. //Create an empty zip file
byte[] emptyzip = new byte[] { 80, 75, 5, 6, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; FileStream fs =
File.Create(newZipFileName);
fs.Write(emptyzip, 0, emptyzip.Length);
fs.Flush();
fs.Close();
fs = null;
//Copy a folder and its contents into the newly created zip file
Shell32.ShellClass sc = new Shell32.ShellClass();
Shell32.Folder SrcFolder = sc.NameSpace(folderPath);
Shell32.Folder DestFolder = sc.NameSpace(newZipFileName);
Shell32.FolderItems items = SrcFolder.Items();
DestFolder.CopyHere(items, 20); I would like to know if
there is a way to get events after this call completes or if there is any
alternate .net API available for the same. Thanks for the help in advance.
Thanks and Regards, Rohan
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]