2012-04-19 139 views
0

我需要通過使用VB的SFTP獲取所有文件名的列表。我試圖把它放在一個ArrayList,但不確定的命令使用..從遠程目錄獲取文件名列表FTP SSH

Public Shared Function Retrieve_Directory_list(ByVal strHost As String, _ 
           ByVal strUsername As String, _ 
           ByVal strPassword As String, _ 
           ByVal strFtpFilePath As String, _ 
           ByVal strlocalFilePath As String) As ArrayList) 

    Dim sshCp As SshTransferProtocolBase 
    Dim res As New ArrayList() 

    sshCp = New Sftp(strHost, strUsername, strPassword) 

    sshCp.Connect() 

'res = sshCp.??? 


    sshCp.Close() 

Return res 

End Function 

請讓我知道如果你需要別的東西。謝謝!

回答

0

我想你想要的東西,如:

sshCp.Connect() 

Dim result as ArrayList() = sshCp.GetFileList("/foldername") 

sshCp.Close() 

Return res