Xceed FTP Library Documentation
GetFolderContents method
XceedFtp control reference > Methods > GetFolderContents method

Description

Get the listing of a folder's contents in the form of an object.

You must specify the type of object you want to receive from this method with the eFormat parameter. Currently, only the Collection object type is supported, and this type is in fact an XceedFtpFolderItems collection object. The XceedFtpFolderItems object itself contains a collection of one or more XceedFtpFolderItem objects - one for each file, folder or link found in the folder being listed.

The sFolderMask parameter lets you specify a filtering mask using wildcards (such as "*.txt") in order to limit which items are listed. The same parameter also allows you to specify a path portion in order to list the contents of another folder. The path portion of the mask may be relative to the current folder, or absolute to the remote system. For example, if the FTP server's current working folder is "/cars", here's what various possibilities for the sFolderMask parameter will do:

The GetFolderContents method is always a synchronous (blocking) call. This means that even if the BackgroundProcessing property is set to true, the Xceed FTP Library will wait until it has received a reply from the FTP server. If you need to do asynchronous (non-blocking) calls, then you will need to use the ListFolderContents method instead.

This method can only be used when the CurrentState property's value is fcsConnected.

Parameters 

Parameter Description
sFolderMask  The mask or the path and mask for filtering listing. If this parameter is left empty, all items in the will be listed.
eFormat  Currently can only be set to fcfCollection..
ppdispItems  The object returned by the method.

Remarks

The ListParsingFlags property determines if the XceedFtp control should parse the FTP server’s directory listing data or leave it up to your application to parse the data by handling the ParsingListLine event.

Declaration  
HRESULT GetFolderContents
(
[in] BSTR sFolderMask,
[in] EXFContentsFormat eFormat,
[out, retval] IDispatch** ppdispItems
)

Applicable properties

AccountName, ListParsingFlags, PassiveMode

Events triggered

LoggingCommandLine