当前位置: 首页>>代码示例>>C#>>正文


C# FileSystem.ListDirectory方法代码示例

本文整理汇总了C#中System.IO.FileSystem.ListDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.ListDirectory方法的具体用法?C# FileSystem.ListDirectory怎么用?C# FileSystem.ListDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.FileSystem的用法示例。


在下文中一共展示了FileSystem.ListDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindFileGrid

        private void BindFileGrid()
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            string path = GetCurrentPath();
            if (path == null) return;

            CFile file = fs.GetFile(path);
            CFile.FileList dirlist;
            try {
                dirlist = fs.ListDirectory(file);
            } catch (CustomException er) {
                dirlist = new CFile.FileList();
                DisplayMessage(er.Message);
            }

            dirlist.Insert(0, file);

            m_curdir = file;
            dgFiles.DataSource = dirlist;
            dgFiles.DataBind();
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:21,代码来源:filebrowser.ascx.cs

示例2: UpdateTreeNode

        protected void UpdateTreeNode(TreeNode node, bool fullreload)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            CFile dir;

            dir = fs.GetFile(node.NodeData);
            if (fullreload) node.Nodes.Clear();
            if (node.Nodes.Count == 0) {

                CFile.FileList dirlist;
                try {
                    dirlist = fs.ListDirectory(dir);
                } catch (CustomException er) {
                    DisplayMessage(er.Message); return;
                }

                if (dirlist.Count > 0)
                    AddToTreeNode(node, dirlist);
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:20,代码来源:filebrowser.ascx.cs

示例3: LoadCourseNode

        private void LoadCourseNode(TreeNode par, int courseID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            Courses courseda = new Courses(Globals.CurrentIdentity);
            Course course = courseda.GetInfo(courseID);

            par.Nodes.Clear();
            //Load announcement folder
            if (!StudentMode)
                AddAnnFolderNode(par.Nodes, courseID);

            //Load content
            CFile.FileList cdir = fs.ListDirectory(fs.GetFile(course.ContentID));
            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }

            //Load assignments
            Assignment.AssignmentList assts;
            if (StudentMode)
                assts = courseda.GetStudentAssignments(courseID);
            else
                assts = courseda.GetAssignments(courseID);
            foreach (Assignment asst in assts)
                AddAsstNode(par.Nodes, asst);

            //Add section folder
            if (!StudentMode) {
                AddBackupsNode(par.Nodes, courseID);
                AddSectionFolderNode(par.Nodes, courseID, "Users and Sections");
                AddPermNode(par.Nodes, courseID);
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:36,代码来源:coursematrix.ascx.cs

示例4: LoadFolderNode

        private void LoadFolderNode(TreeNode par, int fileID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            par.Nodes.Clear();
            CFile.FileList cdir;

            try {
                cdir = fs.ListDirectory(fs.GetFile(fileID));
            } catch (CustomException er) {
                PageError(er.Message); return;
            }

            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:19,代码来源:coursematrix.ascx.cs

示例5: LoadAsstNode

        private void LoadAsstNode(TreeNode par, int asstID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            Assignments asstda = new Assignments(Globals.CurrentIdentity);
            Assignment asst = asstda.GetInfo(asstID);

            //Load content
            par.Nodes.Clear();
            CFile.FileList cdir = fs.ListDirectory(fs.GetFile(asst.ContentID));
            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }

            if (StudentMode) {
                AddSubFolderNode(par.Nodes, asstID);
                AddGroupFolderNode(par.Nodes, asstID);
                AddCompetitionNode(par.Nodes, asstID);
                AddResFolderNode(par.Nodes, asstID);
            }
            else {
                //Load rubric
                Rubric rub = asstda.GetRubric(asstID);
                AddRubricNode(par.Nodes, rub);

                AddFeedbackNode(par.Nodes, asstID);
                AddAutoSysNode(par.Nodes, asstID);

                AddSectionFolderNode(par.Nodes, asst.CourseID, "Users and Sections");

                AddPermNode(par.Nodes, asstID);
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:35,代码来源:coursematrix.ascx.cs


注:本文中的System.IO.FileSystem.ListDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。