FtpClientConnection.ReceiveFiles(String[], String, Boolean, Boolean) 方法

定义

从文件传输协议 (FTP) 服务器接收文件。

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)

参数

remoteFileNames
String[]

FTP 服务器上要接收的文件。

localPath
String

要在其中接收远程文件的本地路径。

overwrite
Boolean

指定是否覆盖本地计算机上已存在的文件。 true 值指示任务将覆盖现有文件。

isTransferAscii
Boolean

指定是否应在 ASCII 模式下接收文件。 true 值指示应在 ASCII 模式下接收文件。

示例

下面的代码示例说明如何使用 ReceiveFiles 方法。

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)  

注解

允许通配符。 例如,从 remoteFileNames /MyFolder/MyFiles*.* 接收将检索以 MyFiles 字符开头的 MyFolder 目录中的所有文件。

适用于