共用方式為


FtpClientConnection.ReceiveFiles(String[], String, Boolean, Boolean) Method

Definition

Receives files from the File Transfer Protocol (FTP) server.

public:
 void ReceiveFiles(cli::array <System::String ^> ^ remoteFileNames, System::String ^ localPath, bool overwrite, bool isTransferAscii);
public void ReceiveFiles (string[] remoteFileNames, string localPath, bool overwrite, bool isTransferAscii);
member this.ReceiveFiles : string[] * string * bool * bool -> unit
Public Sub ReceiveFiles (remoteFileNames As String(), localPath As String, overwrite As Boolean, isTransferAscii As Boolean)

Parameters

remoteFileNames
String[]

The files on the FTP server to receive.

localPath
String

The local path where you want to receive the remote files.

overwrite
Boolean

Specifies whether to overwrite the files, if the files already exist on the local computer. A value of true indicates that the task will overwrite existing files.

isTransferAscii
Boolean

Specifies if files should be received in ASCII mode. A value of true indicates that the files should be received in ASCII mode.

Examples

The following code example shows how to use the ReceiveFiles method.

String [] remoteFileNames = {"myTestFile", "myFTPFile"};  
String localPath = "Program Files";  
myftpClientConn.ReceiveFiles(remoteFileNames, localPath, true, true);   
Dim remoteFileNames() As String = {"myTestFile", "myFTPFile"}  
Dim localPath As String =  "Program Files"   
myftpClientConn.ReceiveFiles(remoteFileNames, localPath, True, True)  

Remarks

Wild-card characters are allowed. For example, receiving from a remoteFileNames of /MyFolder/MyFiles*.* will retrieve from all files in the MyFolder directory that start with the characters MyFiles.

Applies to