下面的代码递归FTP服务器上指定目录下的所有子目录并生成目录树,成功了,效率偏低(是先保存在数据表中,再由数据表生成目录树),请老师指点!想直接生成目录树。
Dim path As String = args(0)
Dim ftp1 As new ftpclient
ftp1.host= "192.168.1.246"
ftp1.Port= "21"
ftp1.Account = "hhe"
ftp1.password = "12"
For Each p As String In ftp1.GetDirList(path)
Tables(“表A”).AddNew
Dim s As String = ""
s = path & "\" & p
s = s.Replace(_TSG & "\","")
Tables(“表A”).Current("分类") = s
Tables(“表A”).Current.Save
Functions.Execute("FTP目录", path & "\" & p)
Next
Dim tv As WinForm.TreeView = Forms("FTP资源管理器").Controls("TreeView1")
tv.CreateTree(“表A”,"分类")
tv.Nodes.Insert(“教育图书”,0)
tv.Nodes(“教育图书”).Ic
[此贴子已经被作者于2014-12-3 22:42:38编辑过]