我想在我的项目中支持拆分 zip 文件,并在 zip 文件是否拆分的情况下有不同的实现。如何检查 zip 文件是否已拆分?
using Ionic.Zip;
protected static bool IsZipFileSplit(string filePath)
{
try
{
ZipFile zipFile = new ZipFile(filePath);
bool isSplit = ?????
return isSplit;
}
catch (ZipException) { }
catch (IOException) { }
}
目前我正在使用 Ionic.Zip (DotNetZip Library)。据我了解,它不会导出有关 zip 文件是否拆分的任何公共数据。它确实具有公共属性 NumberOfSegmentsForMostRecentSave,但该值仅指当前 zip 文件的最后一次保存,而不是使用现有拆分 zip 文件路径打开的新 zip 文件。