Home Forums .NET libraries Xceed SFTP/FTP for .NET Using AbstractFolder to retrieve list of files

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21418 |

    How do I modify the following code to retrieve all the files in a folder?

    For example, to retrieve all xml files in the folder ‘foo’ and its sub-folders.

    Dim instance As AbstractFolder
    Dim recursive as Boolean = true
    Dim filters() as object = “*.xml”
    Dim value() as AbstractFile

    value = instance.GetFiles(recursive, filters)

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Ray (had 718 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Ray,

    The GetFiles method does not automatically allow you to search
    recursively, you will have to add code to do that part. You can use the
    GetFolders method to retrieve sub-folders and then use GetFiles on each
    of them to get all the files.

    I would recommend looking at the Listing the contents of a folder topic in the Documentation, specifically the Things you should consider section at the bottom.

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 914 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.