예제 #1
0
        static void Main(string[] args)
        {
            Console.Write("\n  Testing FileMgr Class");
            Console.Write("\n =======================\n");

            FileMgr fm = new FileMgr();

            fm.addPattern("*.cs");
            fm.findFiles("../../");
            List <string> files = fm.getFile();

            foreach (string file in files)
            {
                Console.Write("\n  {0}", file);
            }
            Console.Write("\n\n");
        }
예제 #2
0
        public string[] getFiles(string path, List <string> patterns)
        {
            FileMgr fm = new FileMgr();

            try
            {
                foreach (string pattern in patterns)
                {
                    fm.addPattern(pattern);
                }
                fm.findFiles(path);
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: '{0}'", e);
            }
            return(fm.getFile().ToArray());
        }