Example #1
0
        public Folder GetRootDirs()
        {
            FolderHelper helper = new FolderHelper();
            Folder folder = new Folder();

            folder.CurrentDir = "";
            folder.Host = HttpContext.Current.Request.Url.Host;
            var dirs = DriveInfo.GetDrives().Select(dir => dir.Name);
            foreach (var dir in dirs)
            {
                helper.GetSizeCount(dir, folder);
            }
            folder.Dirs.AddRange(dirs);

            return folder;
        }
Example #2
0
        public Folder GetDirSub(string path)
        {
            FolderHelper helper = new FolderHelper();
            Folder folder = new Folder();

            if (Directory.Exists(path))
            {
                folder.CurrentDir = path;

                helper.GetFiles(path, folder);
                helper.GetDirs(path, folder);

                folder.Host = HttpContext.Current.Request.Url.Host;
            }
            return folder;
        }