public static void UnZip(object param)
{
object[] args = (object[])param;
string zipFile = (string)args[0];
string folderPath = (string)args[1];
if (!File.Exists(zipFile))
throw new FileNotFoundException();
if (!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
Shell32.Shell objShell = new Shell32.Shell();
Shell32.Folder destinationFolder = objShell.NameSpace(folderPath);
Shell32.Folder sourceFile = objShell.NameSpace(zipFile);
foreach (var file in sourceFile.Items())
{
destinationFolder.CopyHere(file, 4 | 16);
}
}
尝试解压缩文件夹并将其保存在目标Shell32.Folder sourceFile = objShell.NameSpace(zipFile);给出错误。有人可以帮忙吗?