示例#1
0
        static void Main(string[] args)
        {
            if (args.Length != 0)
            {
                Console.WriteLine("Usage: Extrator <file>");
            }

            var file = args[0];
            var dir = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file));

            if (Directory.Exists(dir))
            {
                Directory.Delete(dir);
            }
            Directory.CreateDirectory(dir);

            using (var db = new Numeria.IO.FileDB(file, FileAccess.Read))
            {
                var entities = db.ListFiles();
                foreach (var entity in entities)
                {
                    var filename = UniqueFilename(dir, entity.FileName);
                    Console.WriteLine("Extrating.... " + filename);
                    db.Read(entity.ID, filename);
                }
            }

            Console.WriteLine("Done.");
        }
示例#2
0
        static void Main(string[] args)
        {
            if (args.Length != 0)
            {
                Console.WriteLine("Usage: Extrator <file>");
            }

            var file = args[0];
            var dir  = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file));

            if (Directory.Exists(dir))
            {
                Directory.Delete(dir);
            }
            Directory.CreateDirectory(dir);

            using (var db = new Numeria.IO.FileDB(file, FileAccess.Read))
            {
                var entities = db.ListFiles();
                foreach (var entity in entities)
                {
                    var filename = UniqueFilename(dir, entity.FileName);
                    Console.WriteLine("Extrating.... " + filename);
                    db.Read(entity.ID, filename);
                }
            }

            Console.WriteLine("Done.");
        }