EldoS | Feel safer!

Software components for data protection, secure storage and transfer

DirectoryListbox with SFTPClient.ListDirectory

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 11/17/2010 14:49:26
by Doug Haskins (Basic support level)
Joined: 02/11/2010
Posts: 1

I am working on an inhouse SFTP program. It is using Delphi's DirectoryListbox to display the local file directory, and i'm trying to use the same component to display the remote file directory.

Using SFTPCLient i can connect to the site and collect the directory listing into a TList using OpenDirectory and ListDirectory, but not sure how to get that info into DirectoryListbox, or if there is a better way to do this?

Anyone have an idea on how to link these two components up, or if you have created an SFTP program, how did you display the remote directory listing?


Here is my code so far. It displays the remote directory contents into a memo;

//Set the LocalDirectoryListbox to the local directory
LocalDirectoryListbox.Directory := 'c:\SDXSCommandCenterTemp\SFTPFiles\'+ConnectionCombobox.Text;

//Get the current directory from the site
dirList := TList.Create;

SftpClient.ListDirectory(directoryname, dirList);

for cnt := 0 to dirList.Count - 1 do
Posted: 11/17/2010 23:51:26
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

You should better use TTreeView component to display remote directory contents.

  tn : TTreeNode;
    tn := TreeView1.Items.Add(nil, 'Root');

    for cnt := 0 to dirList.Count - 1 do
      TreeView1.Items.AddChild(tn, ElSftpFileInfo(DirList[cnt]).Name);



Topic viewed 2014 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!