Метод SendFiles
Sends files to the File Transfer Protocol (FTP) server.
Пространство имен: Microsoft.SqlServer.Dts.Runtime
Сборка: Microsoft.SqlServer.ManagedDTS (в Microsoft.SqlServer.ManagedDTS.dll)
Синтаксис
'Декларация
Public Sub SendFiles ( _
localFileNames As String(), _
remotePath As String, _
overwrite As Boolean, _
isTransferAscii As Boolean _
)
'Применение
Dim instance As FtpClientConnection
Dim localFileNames As String()
Dim remotePath As String
Dim overwrite As Boolean
Dim isTransferAscii As Boolean
instance.SendFiles(localFileNames, remotePath, _
overwrite, isTransferAscii)
public void SendFiles(
string[] localFileNames,
string remotePath,
bool overwrite,
bool isTransferAscii
)
public:
void SendFiles(
array<String^>^ localFileNames,
String^ remotePath,
bool overwrite,
bool isTransferAscii
)
member SendFiles :
localFileNames:string[] *
remotePath:string *
overwrite:bool *
isTransferAscii:bool -> unit
public function SendFiles(
localFileNames : String[],
remotePath : String,
overwrite : boolean,
isTransferAscii : boolean
)
Параметры
- localFileNames
Тип: array<System. . :: . .String> [] () [] []
The files on the FTP server to send.
- remotePath
Тип: System. . :: . .String
The remote path where the files are located.
- overwrite
Тип: System. . :: . .Boolean
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
Тип: System. . :: . .Boolean
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)