Purpose
You want to list all files that are stored in a directory on a server and are accessible via SFTP (Secure File Transfer Protocol).
Solution
In the standard .NET library from Microsoft, which is installed on every Windows PC, there is only one client for unencrypted FTP. However, you can use and call the open-source library SSH.NET in a separate DLL.



Create the library in Visual Studio
Start with a new project that is defined as a class library. Alternatively, you can start with the sample project which you can download at the bottom of this page or just use the compiled libraries.

Add references to guinet.dll (for communication with GuiXT) and Renci.SshNet.dll, which you can easily add automatically to the project using the NuGet Package Manager in Visual Studio.

Compile the project and copy the created DLL files to the class library directory defined in the GuiXT profile.
 
The GuiXT Script

Pushbutton   (3,2)    "Fetch FTP files"  process="fetch_ftp_files.txt"   

    Table          (5,2)    (14,54)  _
     
title="Files on FTP Server" _
     
name="ftpfiles" _
     
rows="&V[ftpfiles.rowcount]"    

Column "Filename" size=50 name="filename"

 
The InputScript "fetch_ftp_files.txt"

createtable V[ftpfiles] filename 

callvb r = guixtwebservices.guixtftp.ReadDirectory   _
 
hostname:="ftp.myftpserver.com"  _
 
username:="user123" _
 
password:="pass123" _
 
directory:="myfiles" _
 
guixtvariable:="ftpfiles"  

message "&V[r]" -statusline

 
Downloads

VB.NET sample project

Compiled libraries
 
Components
InputAssistant + Controls