Beispiel #1
0
        /// <summary>
        /// 检查zip文件中是否包含制定类型的文件
        /// </summary>
        /// <param name="zipfile"></param>
        /// <param name="extension"></param>
        /// <returns></returns>
        public static bool CheckZipFiles(string zipfile, string extension)
        {
            ReadOptions opt = new ReadOptions();

            using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile(zipfile))
            {
                return(zip.Any(x => Path.GetExtension(x.FileName).ToLower() == extension));
            }
        }
Beispiel #2
0
 public bool IsFileExist(string path)
 {
     return(zip.Any(entry => entry.FileName == path));
 }