Exemplo n.º 1
0
        public FileList(string pak)
        {
            InitializeComponent();
            pakfile = new PAKFile(pak);

            Text = pak;
            listBox1.Items.AddRange(pakfile.Files.ToArray());
        }
Exemplo n.º 2
0
 public static void DeserializePakToDir(string pakfile, string dir)
 {
     PAKFile pak = new PAKFile(pakfile);
     if (!Directory.Exists(dir)) {
         Directory.CreateDirectory(dir);
     }
     foreach (var file in pak.Files) {
         string fullpath = Path.Combine(dir, file);
         string subDir = Path.GetDirectoryName(fullpath);
         Console.WriteLine("Unpacking {0}", file);
         if (!Directory.Exists(subDir)) {
             Directory.CreateDirectory(subDir);
         }
         System.IO.File.WriteAllBytes(fullpath, pak[file]);
     }
 }