Catalyst File Transfer .NET

FileTransfer.GetFirstFile Method (String, Boolean)

Get information about the first file in a directory listing returned by the server.

[Visual Basic]
Overloads Public Function GetFirstFile( _
   ByRef fileName As String, _
   ByRef isDirectory As Boolean _
) As Boolean
[C#]
public bool GetFirstFile(
   ref string fileName,
   ref bool isDirectory
);

Parameters

fileName
A string passed by reference which will contain a file name when the method returns.
isDirectory
A boolean passed by reference which will specify if the file is a regular file or a directory. A value of true indicates that the file is a directory. A value of false indicates that it is a regular file.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

A file listing is initiated by calling the OpenDirectory method. Then, the application must call GetFirstFile, followed by calling GetNextFile in a loop until the method returns false. Once the complete directory listing has been returned, the CloseDirectory method must be called.

This file list information returned by the server is cached by the class library, allowing you to use this method to reposition back to the beginning of the file list.

See Also

FileTransfer Class | SocketTools Namespace | FileTransfer.GetFirstFile Overload List