示例#1
0
        public static void DumpLzhEntries(string source_file)
        {
            Console.WriteLine("# lzh " + source_file);
            IArchive arc = new LzhArchive();

            DumpArcEntries(source_file, arc);
        }
示例#2
0
        public static void ZipDumpArcEntries(ArcsDatabase db, ArcsZipArcEntry entry)
        {
            string ext = Path.GetExtension(entry.path).ToLower();

            switch (ext)
            {
            case ".zip":
                using (IArchive arc = new ZipArchive())
                {
                    DumpArcEntries(db, Path.Combine(TDCGExplorer.SystemDB.zips_path, entry.path), arc, entry.id);
                }
                break;

            case ".rar":
                using (IArchive arc = new RarArchive())
                {
                    DumpArcEntries(db, Path.Combine(TDCGExplorer.SystemDB.zips_path, entry.path), arc, entry.id);
                }
                break;

            case ".lzh":
                using (IArchive arc = new LzhArchive())
                {
                    DumpArcEntries(db, Path.Combine(TDCGExplorer.SystemDB.zips_path, entry.path), arc, entry.id);
                }
                break;

            default:
                break;
            }
        }
示例#3
0
        // ZIPファイルを展開する.
        public static bool ExtractZipFile(string srcfile, string destpath)
        {
            switch (Path.GetExtension(srcfile.ToLower()))
            {
            case ".zip":
                using (IArchive arc = new ZipArchive())
                {
                    return(ExtractZip(arc, srcfile, destpath));
                }

            case ".rar":
                using (IArchive arc = new RarArchive())
                {
                    return(ExtractZip(arc, srcfile, destpath));
                }

            case ".lzh":
                using (IArchive arc = new LzhArchive())
                {
                    return(ExtractZip(arc, srcfile, destpath));
                }

            default:
                using (IArchive arc = new DirectAccessArchive())
                {
                    return(ExtractZip(arc, srcfile, destpath));
                }
            }
        }
示例#4
0
        public void ExtractFile()
        {
            if (info.zipid != -1)
            {
                ArcsZipArcEntry zipEntry  = TDCGExplorer.GetArcsDatabase().GetZip(info.zipid);
                string          zipsource = Path.Combine(TDCGExplorer.GetSystemDatabase().zips_path, zipEntry.path);
                switch (Path.GetExtension(zipEntry.path.ToLower()))
                {
                case ".zip":
                    using (IArchive arc = new ZipArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                case ".rar":
                    using (IArchive arc = new RarArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                case ".lzh":
                    using (IArchive arc = new LzhArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                default:
                    break;
                }
            }
        }