Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 仅从zip的目录中提取文件_C#_Unzip - Fatal编程技术网

C# 仅从zip的目录中提取文件

C# 仅从zip的目录中提取文件,c#,unzip,C#,Unzip,我使用的是Ionic.Zip,它是如何从Zip文件中提取文件的 foreach (ZipEntry entry in zip) { if (entry.IsDirectory) { entry.Extract(extractPath); var s = entry.ExtractExistingFile; } } 您要提取特定目录还是所有目录?我要提取特定目录。然后entry.IsDirectory为true,在entry.Extra

我使用的是Ionic.Zip,它是如何从Zip文件中提取文件的

foreach (ZipEntry entry in zip)
{
    if (entry.IsDirectory)
    {
        entry.Extract(extractPath);
        var s = entry.ExtractExistingFile;

     }
}

您要提取特定目录还是所有目录?我要提取特定目录。然后entry.IsDirectory为true,在entry.Extract(extractPath)中出现异常“值不能为null”;