Aracılığıyla paylaş


TaskHost.GetPackagePath Yöntemi

Döndürür yol görev konumu için.

Ad Alanı:  Microsoft.SqlServer.Dts.Runtime
Derleme:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS içinde.dll)

Sözdizimi

'Bildirim
Public Function GetPackagePath As String
'Kullanım
Dim instance As TaskHost
Dim returnValue As String

returnValue = instance.GetPackagePath()
public string GetPackagePath()
public:
virtual String^ GetPackagePath() sealed
abstract GetPackagePath : unit -> string 
override GetPackagePath : unit -> string 
public final function GetPackagePath() : String

Dönüş Değeri

Tür: System.String
A dize , paket konumunu içerir.

Uygulamalar

IDTSPackagePath.GetPackagePath()

Örnekler

Aşağıdaki kod örneği ekler bir sıra kaba bir paket, sonra ekler bir FileSystemTask.Kullanarak GetPackagePath, paket için yol FileSystemTask döndürülür.

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 mySample
    {
        static void Main(string[] args)
        {
            Package package = new Package();
            Sequence seq = (Sequence)package.Executables.Add("STOCK:SEQUENCE");

            // Add a File System task.
            Executable eFileTask1 = seq.Executables.Add("STOCK:FileSystemTask");
            TaskHost thFileTask1 = eFileTask1 as TaskHost;

            // Use GetPackagePath of the TaskHost.
            String pkgPath = thFileTask1.GetPackagePath();
            Console.WriteLine("Package path: {0}", pkgPath);
        }
    }
}
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 mySample
        Shared  Sub Main(ByVal args() As String)
            Dim package As Package =  New Package() 
            Dim seq As Sequence = CType(package.Executables.Add("STOCK:SEQUENCE"), Sequence)
 
            ' Add a File System task.
            Dim eFileTask1 As Executable =  seq.Executables.Add("STOCK:FileSystemTask") 
            Dim thFileTask1 As TaskHost =  eFileTask1 as TaskHost 
 
            ' Use GetPackagePath of the TaskHost.
            Dim pkgPath As String =  thFileTask1.GetPackagePath() 
            Console.WriteLine("Package path: {0}", pkgPath)
        End Sub
    End Class
End Namespace

Örnek Çıktı:

Paketin yol: {\Package\{4CE5CB4E-E124-4523-BE8B-D934BAF907D5}\{BFD1E4F1-53CF-4130-989E-E11FD853DA18}