예제 #1
0
        static void Main(string[] args)
        {
            string Path = System.IO.Directory.GetCurrentDirectory();
            string Target = System.IO.Directory.GetCurrentDirectory() + "\\FastDL";

            if (System.IO.Directory.Exists(Target))
                System.IO.Directory.Delete(Target, true);

            FileManager FM = new FileManager(Path);
            string NewFile;
            int Depth;
            int cnt = 0;

            foreach(File file in FM.Files)
            {
                if (Ignore(file.Ext) || !file.IsWithinDirectory("addons"))
                    continue;

                NewFile = "";
                Depth = 0;

                foreach (string folder in file.Path)
                {
                    if (Depth == 0 && folder.ToLower() == "addons")
                    {
                        Depth++;
                        continue;
                    }
                    else if (Depth == 1)
                    {
                        Depth++;
                    }
                    else if (Depth==2)
                    {
                        NewFile += folder+"/";
                    }
                }

                Console.Out.WriteLine(Target + NewFile + file.Name + file.Ext + " -> " + file.GetFullPath());
                FM.Copy(Target + "\\" + NewFile + file.Name + file.Ext, file.GetFullPath());
                FM.Compress(Target + "\\" + NewFile + file.Name + file.Ext);
                cnt++;
            }

            System.Console.Out.WriteLine("\nDONE! "+cnt+" files copied and compressed!");
            System.Console.In.ReadLine();
        }