我正在为应用程序下载的文件夹编写一个解压缩程序,但出现System.IO.IOException:“提取Zip条目将导致文件超出指定的目标目录。”错误, 我的代码是:
string sourceZipfile = @".\Exploit\Jam X.zip";
string targetFolder = @".\Jam X";
ZipFile.ExtractToDirectory(sourceZipfile, targetFolder);
Directory.Delete(sourceZipfile);
Console.WriteLine("Unzipped Jam X!");
我对此很陌生,有人可以帮我解决此问题吗?有人可以简单解释吗?