Rebex.FTP treeView loading folders and files

0 votes
asked Nov 25, 2015 by Lucas (120 points)

I'm using Rebex FTP library. My question is about making treeview from directories and files on the server. I don't know how make dynamic loading. There is a tree with main folders, I'm click on one Node and library load from FTP content of this folder like in many FTP Clients. How I can make this?

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Nov 25, 2015 by Lukas Matyska (59,010 points)

To implement requested functionality, use these methods:

  • Ftp.ChangeDirectory()
  • Ftp.GetList()

The rest is up to you. You can start with a sample code I've made for you.

Please note, that some servers don't accept full paths for changing directories (the ChangeDirectory method) and some servers don't use slash '/' as directory separator.

Because of this, I've made two examples - FtpTreeViewSimple and FtpTreeView (see mentioned sample code). The first one demonstrates how to make dynamically built TreeViews. Second one extends the first one to show how to navigate in a FTP folder structure without necessity to use full paths or any directory separators.

...