DTSFTPOp 列挙型

定義

FTPタスクの事前定義された操作の集合を一覧化します。

public enum class DTSFTPOp
public enum DTSFTPOp
type DTSFTPOp = 
Public Enum DTSFTPOp
継承
DTSFTPOp

フィールド

名前 説明
Send 0

ローカル コンピューターのファイルを FTP サーバーに送信します。

Receive 1

FTP サーバーのファイルをローカル コンピューターに保存します。

DeleteLocal 2

ローカル コンピューターのファイルを削除します。

DeleteRemote 3

FTP サーバーのファイルを削除します。

MakeDirLocal 4

ローカルコンピュータにディレクトリを作成します。

MakeDirRemote 5

FTPサーバー上にディレクトリを作成します。

RemoveDirLocal 6

ローカルコンピュータ上のディレクトリを削除します。

RemoveDirRemote 7

FTPサーバー上のディレクトリを削除します。

以下のコード例は FtpTaskを作成し、作成後に含まれているデフォルト値を示します。 一部のフィールドは空であり、パッケージ内でタスクを実行する前に明示的に設定する必要があります。 サンプルは、この列挙を使ってFtpTaskOperation特性を設定する方法を示しています。

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  

出力例:

Connection

DebugMode False

実行値 0

IsLocalPathVariable False

IsRemotePathVariable False

IsTransferTypeASCII False

ローカルパス

オペレーション0

オペレーションネーム

上書きDestination False

リモートパス

停止:作戦失敗 真

停止必須の虚偽

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

演算の新しい値:1

注釈

詳細については、「 FTP タスク」を参照してください。

適用対象