示例#1
0
        public RarDirectoryInfo(BaseFileInfo fileInfo)
        {
            _rarPath = fileInfo.FullPath;
            _parentDir = fileInfo.Directory;
            _lastModifiedTime = fileInfo.LastModifiedTime;

            foreach (Schematrix.RARFileInfo rarFInfo in UnrarReader.GetFiles(_rarPath))
                _fileInfoList.Add(new RarFileInfo(this, _rarPath, rarFInfo));

            //TODO Directory support
        }
示例#2
0
        public ZipDirectoryInfo(BaseFileInfo fileInfo)
        {
            //TODO Add directory support
            _zipPath = fileInfo.FullPath;
            _lastModifiedTime = fileInfo.LastModifiedTime;
            _parentDir = fileInfo.Directory;

            using (FileStream fs = File.OpenRead(_zipPath))
            {
                using (ZipInputStream zs = new ZipInputStream(fs))
                {
                    ZipEntry entry;
                    while ((entry = zs.GetNextEntry()) != null)
                    {
                        if (!entry.IsFile)
                            continue;
                        _fileInfos.Add(new ZipFileInfo(this, _zipPath, entry));
                        _fileInfos.Sort();
                    }
                }
            }
        }