DTSFTPOp Enumerazione

Definizione

Elenca il set di operazioni predefinite per l'attività FTP.

public enum class DTSFTPOp
public enum DTSFTPOp
type DTSFTPOp = 
Public Enum DTSFTPOp
Ereditarietà
DTSFTPOp

Campi

DeleteLocal 2

Consente di eliminare un file nel computer locale.

DeleteRemote 3

Consente di eliminare un file nel server FTP.

MakeDirLocal 4

Crea una directory nel computer locale.

MakeDirRemote 5

Crea una directory nel server FTP.

Receive 1

Salva sul computer locale un file scaricato dal server FTP.

RemoveDirLocal 6

Elimina una directory nel computer locale.

RemoveDirRemote 7

Elimina una directory nel server FTP.

Send 0

Invia un file dal computer locale al server FTP.

Esempio

Nell'esempio di codice seguente viene creato un oggetto FtpTask, quindi vengono visualizzati i valori predefiniti contenuti dopo la creazione. Alcuni campi sono vuoti e devono essere impostati in modo esplicito prima dell'esecuzione dell'attività nel pacchetto. Nell'esempio viene illustrato come utilizzare questa enumerazione per impostare la Operation proprietà di 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));  

            Console.WriteLine("--------------------------");  
            // 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));  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.FtpTask  

Namespace FTPTask  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim exec1 As Executable =  pkg.Executables.Add("STOCK:FTPTask")   
            Dim th As TaskHost =  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))  

            Console.WriteLine("--------------------------")  
            ' 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))  
        End Sub  
    End Class  
End Namespace  

Esempio di output

Connessione

DebugMode False

ExecutionValue 0

IsLocalPathVariable False

IsRemotePathVariable False

IsTransferTypeASCII False

LocalPath

Operazione 0

OperationName

SovrascriviDestination False

RemotePath

StopOnOperationFailure True

SuspendRequired False

--------------------------

Nuovo valore dell'operazione: 1

Commenti

Per altre informazioni, vedere Attività FTP.

Si applica a