FtpClientConnection.Retries Property
Gets or sets the number of times the task attempts an operation. A value of 0 indicates that there is no limit on attempts.
Espacio de nombres: Microsoft.SqlServer.Dts.Runtime
Ensamblado: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
Sintaxis
'Declaración
Public Property Retries As Integer
public int Retries { get; set; }
public:
property int Retries {
int get ();
void set (int value);
}
/** @property */
public int get_Retries ()
/** @property */
public void set_Retries (int value)
public function get Retries () : int
public function set Retries (value : int)
Valor de propiedad
An Integer that specifies the number of times the File Transfer Protocol (FTP) connection attempts to send the packet before failing.
Notas
Default value is 5. The minimum acceptable value is 1, and the maximum acceptable value is 100.
Ejemplo
The most common method of creating the FTP client connection is by using the ConnectionManager. The InnerObject contains the connection, and all properties of the specific connection contained by the ConnectionManager are accessible through the Properties collection. The following code example shows the creation of an FTP connection using the connection manager, and sets properties using the Properties collection.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;
namespace Microsoft.SqlServer.SSIS.Samples
{
class mySqlServer_Sample
{
static void Main(string[] args)
{
Package pkg = new Package();
FtpClientConnection ftp = null;
Connections conns = pkg.Connections;
ConnectionManager cm = conns.Add("FTP");
// Display the default values of the FTP connection properties.
// Some properties are not shown as they are write-only.
Console.WriteLine("ChunkSize: {0}", cm.Properties["ChunkSize"].GetValue(cm));
Console.WriteLine("Retries: {0}", cm.Properties["Retries"].GetValue(cm));
Console.WriteLine("ServerName: {0}", cm.Properties["ServerName"].GetValue(cm));
Console.WriteLine("ServerPort: {0}", cm.Properties["ServerPort"].GetValue(cm));
Console.WriteLine("ServerUserName: {0}", cm.Properties["ServerUserName"].GetValue(cm));
Console.WriteLine("Timeout: {0}", cm.Properties["Timeout"].GetValue(cm));
Console.WriteLine("UsePassiveMode: {0}",cm.Properties["UsePassiveMode"].GetValue(cm));
Console.WriteLine();
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.FileSystemTask
Namespace Microsoft.SqlServer.SSIS.Samples
Class mySqlServer_Sample
Shared Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim ftp As FtpClientConnection = Nothing
Dim conns As Connections = pkg.Connections
Dim cm As ConnectionManager = conns.Add("FTP")
' Display the default values of the FTP connection properties.
' Some properties are not shown as they are write-only.
Console.WriteLine("ChunkSize: {0}", cm.Properties("ChunkSize").GetValue(cm))
Console.WriteLine("Retries: {0}", cm.Properties("Retries").GetValue(cm))
Console.WriteLine("ServerName: {0}", cm.Properties("ServerName").GetValue(cm))
Console.WriteLine("ServerPort: {0}", cm.Properties("ServerPort").GetValue(cm))
Console.WriteLine("ServerUserName: {0}", cm.Properties("ServerUserName").GetValue(cm))
Console.WriteLine("Timeout: {0}", cm.Properties("Timeout").GetValue(cm))
Console.WriteLine("UsePassiveMode: {0}",cm.Properties("UsePassiveMode").GetValue(cm))
Console.WriteLine()
End Sub
End Class
End Namespace
Sample Output:
ChunkSize: 1
Retries: 5
ServerName:
ServerPort: 21
ServerUserName:
Timeout: 60
UsePassiveMode: False
Seguridad para subprocesos
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.
Plataformas
Plataformas de desarrollo
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Plataformas de destino
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Vea también
Referencia
FtpClientConnection Class
FtpClientConnection Members
Microsoft.SqlServer.Dts.Runtime Namespace