Topic "How to Use RemoteFileInfoCollection"

Author Message
leokun
[View user's profile]

Joined: 2013-03-05
Posts: 1
Location: france
Hi everyone,

I've just try to build an app to copy fils from an ovh ssh server and make it myself seem prety goot try to me.
(By using VB .Net -on MVS2012)

What I'm doing :
connect to the server, explore one folder with subfolders and looking for tar.gz files to topy thoses files.

There is my recursive code to copy files :
Code:

Sub CopyTarGz(ByVal dossier As String)
    Dim directory As RemoteDirectoryInfo = maSession.ListDirectory(dossier)
    Dim fileInfo As RemoteFileInfo
    Dim maCollec As New RemoteFileInfoCollection()
    For Each fileInfo In directory.Files
        If fileInfo.IsDirectory And Not fileInfo.Name.StartsWith(".") Then : CopyTarGz(dossier + fileInfo.Name)
        ElseIf fileInfo.Name.EndsWith("tar.gz") Then : maCollec.Add(fileInfo)
        End If
    Next
End Sub

the issue that I have is that my RemoteFileInfoCollection is readonly and I can't unlock it.

I'm a beginer at programming, but if I did understand well, I might be able to use this collection to store the RemoteFileInfo I want to copy later. Am I doing something wrong ?

Please let me know if you can help me, I only want to copy those tar.gz files and nothing else.

Thanks a lot !

Regards, Lo

ps : Sorry if my code is not that clean, I'm programming only since few months, also sorry about my english Smile
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License