共用方式為


FtpClientConnection.SendFiles Method

Sends files to the File Transfer Protocol (FTP) server.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Sub SendFiles ( _
    localFileNames As String(), _
    remotePath As String, _
    overwrite As Boolean, _
    isTransferAscii As Boolean _
)
public void SendFiles (
    string[] localFileNames,
    string remotePath,
    bool overwrite,
    bool isTransferAscii
)
public:
void SendFiles (
    array<String^>^ localFileNames, 
    String^ remotePath, 
    bool overwrite, 
    bool isTransferAscii
)
public void SendFiles (
    String[] localFileNames, 
    String remotePath, 
    boolean overwrite, 
    boolean isTransferAscii
)
public function SendFiles (
    localFileNames : String[], 
    remotePath : String, 
    overwrite : boolean, 
    isTransferAscii : boolean
)

參數

  • localFileNames
    The files on the FTP server to send.
  • remotePath
    The remote path where the files are located.
  • overwrite
    Specifies whether to overwrite the files, if the files already exist on the remote computer. A value of true indicates that the task will overwrite existing files.
  • isTransferAscii
    Specifies if files should be sent in ASCII mode. A value of true indicates that the files should be sent in ASCII mode.

範例

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

  Package pkg = new Package();
  Connections conns = pkg.Connections;
  ConnectionManager cm = conns.Add("FTP");
  //...
  FtpClientConnection myftpClientConn = new FtpClientConnection(cm);
  String[] localFileNames = { "myTestFile", "myFTPFile" };
  String remotePath = @"\\myserver\myFolder";
  myftpClientConn.SendFiles(localFileNames, remotePath, true, false);
  Dim pkg As New Package()
  Dim conns As Connections = pkg.Connections
  Dim cm As ConnectionManager = conns.Add("FTP")
  '...
  Dim myftpClientConn As New FtpClientConnection(cm)
  Dim localFileNames() As String = {"myTestFile", "myFTPFile"}
  Dim remotePath As String = "\\myserver\myFolder"
  myftpClientConn.SendFiles(localFileNames, remotePath, True, False)

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

FtpClientConnection Class
FtpClientConnection Members
Microsoft.SqlServer.Dts.Runtime Namespace