ZipDotNet将文件路径从目录返回到zip

时间:2012-12-14 20:30:08

标签: c# wpf

我设法从档案中获取文件,但我得到这样的价值......

ZipEntry://path/to/file

我如何才能获得像这样的文件路径......

path/to/file

到目前为止,这是我的代码

internal static Array GetFiles(string haystack, string needle = "*")
{
  var resources = ZipFile.Read(ResourcePath);
  resources.Password = ResourcePassword;
  return resources.SelectEntries(needle, haystack).ToArray();
}

请注意,这是简单的代码,没有错误检查

1 个答案:

答案 0 :(得分:0)

只需替换每个条目的ZipEntry前缀。

path.Replace("ZipEntry://", "");
相关问题