DTSFTPOp Enumeration

Lists the set of predefined operations for the FTP task.

Namespace:  Microsoft.SqlServer.Dts.Tasks.FtpTask
Assembly:  Microsoft.SqlServer.FtpTask (in Microsoft.SqlServer.FtpTask.dll)

public enum DTSFTPOp

Member nameDescription
SendSends a file from the local computer to the FTP server.
ReceiveSaves a file from the FTP server to the local computer.
DeleteLocalDeletes a file on the local computer.
DeleteRemoteDeletes a file on the FTP server.
MakeDirLocalCreates a directory on the local computer.
MakeDirRemoteCreates a directory on the FTP server.
RemoveDirLocalDeletes a directory on the local computer.
RemoveDirRemoteDeletes a directory on the FTP server.

For more information, see FTP Task.

The following code example creates an FtpTask, then shows the default values it contains after creation. Some fields are empty, and must be explicitly set before the task is executed in the package. The sample shows how to use this enumeration to set the Operation property of the FtpTask.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.FtpTask;

namespace FTPTask
    class Program
        static void Main(string[] args)
            Package pkg = new Package();
            Executable exec1 = pkg.Executables.Add("STOCK:FTPTask");
            TaskHost th = exec1 as TaskHost;

            // List the default values of the FTP task
            // using the Properties collection of the TaskHost.
            Console.WriteLine("Connection           {0}", th.Properties["Connection"].GetValue(th));
            Console.WriteLine("DebugMode            {0}", th.Properties["DebugMode"].GetValue(th));
            Console.WriteLine("ExecutionValue       {0}", th.Properties["ExecutionValue"].GetValue(th));
            Console.WriteLine("IsLocalPathVariable  {0}", th.Properties["IsLocalPathVariable"].GetValue(th));
            Console.WriteLine("IsRemotePathVariable {0}", th.Properties["IsRemotePathVariable"].GetValue(th));
            Console.WriteLine("IsTransferTypeASCII  {0}", th.Properties["IsTransferTypeASCII"].GetValue(th));
            Console.WriteLine("LocalPath            {0}", th.Properties["LocalPath"].GetValue(th));
            Console.WriteLine("Operation            {0}", th.Properties["Operation"].GetValue(th));
            Console.WriteLine("OperationName        {0}", th.Properties["OperationName"].GetValue(th));
            Console.WriteLine("OverwriteDestination {0}", th.Properties["OverwriteDestination"].GetValue(th));
            Console.WriteLine("RemotePath           {0}", th.Properties["RemotePath"].GetValue(th));
            Console.WriteLine("StopOnOperationFailure  {0}", th.Properties["StopOnOperationFailure"].GetValue(th));
            Console.WriteLine("SuspendRequired      {0}", th.Properties["SuspendRequired"].GetValue(th));

            // Show how to set a property using the TaskHost Properties.
            th.Properties["Operation"].SetValue(th, DTSFTPOp.Receive);
            Console.WriteLine("New value of Operation:  {0}", th.Properties["Operation"].GetValue(th));

Sample Output:


DebugMode False

ExecutionValue 0

IsLocalPathVariable False

IsRemotePathVariable False

IsTransferTypeASCII False


Operation 0


OverwriteDestination False


StopOnOperationFailure True

SuspendRequired False


New value of Operation: 1

Community Additions