Export (0) Print
Expand All

FtpClientConnection.Timeout Property

Gets or sets a value that indicates how long to attempt the connection before timing out.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public int Timeout { get; set; }

Property Value

Type: Int32
An Integer that contains the number of seconds to wait before failing the connection.

The default value is 60 seconds. The minimum value is 1 second, and the maximum value is 300 seconds.

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();
        }
    }
}

Sample Output:

ChunkSize: 1

Retries: 5

ServerName:

ServerPort: 21

ServerUserName:

Timeout: 60

UsePassiveMode: False

Community Additions

ADD
Show:
© 2014 Microsoft