Ejemplo n.º 1
0
        static public RenbanFiles GetFiles(RenbanName rn)
        {
            RenbanFiles ret = new RenbanFiles();

            if (rn.IsFrame == false)
            {
                return(ret);
            }
            if (rn.Directory == "")
            {
                rn.Directory = ".\\";
            }
            DirectoryInfo d = new DirectoryInfo(rn.Directory);

            if (d.Exists == false)
            {
                return(ret);
            }
            rn.Directory = d.FullName;

            var di    = new DirectoryInfo(rn.Directory);
            var files = di.EnumerateFiles(rn.Node + "*" + rn.Ext, SearchOption.TopDirectoryOnly);

            if (files.Count <FileInfo>() <= 0)
            {
                return(ret);
            }

            foreach (FileInfo fi in files)
            {
                RenbanName rn2 = new RenbanName(fi.FullName);
                ret.AddFileName(rn2);
            }
            return(ret);
        }
Ejemplo n.º 2
0
        // *************************************************
        static public RenbanFiles[] GetFiles(string FolderPass)
        {
            List <RenbanFiles> ret = new List <RenbanFiles>();

            var di    = new DirectoryInfo(FolderPass);
            var files = di.EnumerateFiles("*", SearchOption.TopDirectoryOnly);

            if (files.Count <FileInfo>() <= 0)
            {
                return(new RenbanFiles[0]);
            }

            foreach (FileInfo fi in files)
            {
                RenbanName rn = new RenbanName(fi.FullName);
                if (rn.IsFrame == false)
                {
                    continue;
                }
                if (ret.Count <= 0)
                {
                    RenbanFiles rf = new RenbanFiles();
                    ret.Add(rf);
                }
                if (ret[ret.Count - 1].AddFileName(rn) == false)
                {
                    RenbanFiles rf = new RenbanFiles();
                    rf.AddFileName(rn);
                    ret.Add(rf);
                }
            }
            return(ret.ToArray());
        }