内部函数Dim tr As WinForm.TreeNode = args(0)
If FileSys.DirectoryExists(tr.name) Then
For Each dir As String In FileSys.GetDirectories(tr.name)
Dim cd As WinForm.TreeNode = tr.Nodes.Add(dir)
Functions.Execute("AddChildren",cd)
Next
ElseIf FileSys.FileExists(tr.name) Then
Dim cd As WinForm.TreeNode = tr.Nodes.Add(tr.name)
End If
目录树生成代码
Dim tv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd As WinForm.TreeNode
For Each DInfo As IO.DriveInfo In IO.DriveInfo.GetDrives
If dinfo.Isready Then
nd = tv.Nodes.Add(dinfo.name)
For Each dir As String In FileSys.GetDirectories(dinfo.name)
Dim cd As WinForm.TreeNode = nd.Nodes.Add(dir,dir.Replace(dinfo.name,""))
Functions.Execute("AddChildren",nd)
Next
For Each dir As String In FileSys.GetFiles(dinfo.name)
Dim cd As WinForm.TreeNode = nd.Nodes.Add(dir,dir.Replace(dinfo.name,""))
Next
End If
Next
求指导 哪里错了
[此贴子已经被作者于2017/4/5 15:27:33编辑过]