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);
}
参数:
oItem |
Required. The System.Shell.Item to copy. |
Optional. Integer that specifies any combination of copy operation options.
Note These values are based on flags defined for use with the fFlags member of the C++ SHFILEOPSTRUCT structure. These flags are not defined for Microsoft Visual Basic, Visual Basic Scripting Edition (VBScript), or Microsoft JScript, so you must define the values or use their numeric equivalents.
- 0
- Default. No options specified.
4
- Do not display a progress dialog box.
8
- Rename the target file if a file exists at the target location with the same name.
16
- Click "Yes to All" in any dialog box displayed.
64
- Preserve undo information, if possible.
128
- Perform the operation only if a wildcard file name (*.*) is specified.
256
- Display a progress dialog box but do not show the file names.
512
- Do not confirm the creation of a new directory if the operation requires one to be created.
1024
- Do not display a user interface if an error occurs.
4096
- Disable recursion.
8192
- Do not copy connected files as a group. Only copy the specified files.
具体可参考:
http://msdn.microsoft.com/en-us/library/ms723207(VS.85).aspx
更多DotNet好文章www.zdexe.com