다음을 통해 공유


LogProvider.GetPackagePath Method

Returns a String that contains the relative path to the package location.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Function GetPackagePath As String
public string GetPackagePath ()
public:
virtual String^ GetPackagePath () sealed
public final String GetPackagePath ()
public final function GetPackagePath () : String

반환 값

A String that contains the path to the package.

The following code sample returns the package path from the log provider.

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

namespace LogProvider_Expression_Tests
{
    class Program
    {
        static void Main(string[] args)
        {
            // The package is one of the SSIS Samples. The package was
            // modified to log to the SSIS log provider for Text files
            // and saved before loading into this code.

            string mySample = @"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";

            // Create the Application, and load the sample.
            Application app = new Application();
            Package pkg = app.LoadPackage(mySample, null);

            // Get the LogProviders collection.
            LogProviders logProvs = pkg.LogProviders;

            // Get the "SSIS log provider for Text files"
            // provider from the collection.
            LogProvider textLogProv = logProvs["SSIS log provider for Text files"];
     
            // Get the package path from the log provider.
            String pkgPath = textLogProv.GetPackagePath();
            Console.WriteLine("Package path: {0}", pkgPath);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace LogProvider_Expression_Tests
    Class Program
        Shared  Sub Main(ByVal args() As String)
            ' The package is one of the SSIS Samples. The package was
            ' modified to log to the SSIS log provider for Text files
            ' and saved before loading into this code.
 
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx" 
 
            ' Create the Application, and load the sample.
            Dim app As Application =  New Application() 
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing) 
 
            ' Get the LogProviders collection.
            Dim logProvs As LogProviders =  pkg.LogProviders 
 
            ' Get the "SSIS log provider for Text files"
            ' provider from the collection.
            Dim textLogProv As LogProvider =  logProvs("SSIS log provider for Text files") 
 
            ' Get the package path from the log provider.
            Dim pkgPath As String =  textLogProv.GetPackagePath() 
            Console.WriteLine("Package path: {0}", pkgPath)
        End Sub
    End Class
End Namespace

Sample Output:

Package path: \Package.LogProviders[{2A89B1C0-E01E-4E1B-89E3-02DDFF291D70}]

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

LogProvider Class
LogProvider Members
Microsoft.SqlServer.Dts.Runtime Namespace