CEN decompress the. ZIP file and search a lot of methods on the Internet, using System. IO. compression. GZipStream uses the J # library function and the Java-based library function. However, many of them are not very good. In the end, it is still the System function System. shell. folder. copyHere (
OItem
[
,
IntOptions. The specific method is as follows:
1. Add the reference Shell32.dll, which can be found in Windows \ system32.
2. Add the method. Static void UnZip (string zipFile, string destFolder)
{
Shell32.ShellClass SC = new Shell32.ShellClass ();
Shell32.Folder SrcFolder = SC. NameSpace (zipFile );
Shell32.Folder DestFolder = SC. NameSpace (destFolder );
Shell32.FolderItems items = SrcFolder. Items ();
DestFolder. CopyHere (items, 20 );
}
(Note that destFolder must exist in advance. This method will not automatically create a folder)
DestFolder. in CopyHere (items, 20), 20 is actually an intOptions flags (4 | 16). 4 indicates that the processing window is not displayed, 16. If the processing window is displayed, select "yes to all ". For more information about intOptions, visit http://msdn2.microsoft.com/en-us/library/ms723207.aspx.