本文整理汇总了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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}