LogProvider.ID 属性

定义

获取 LogProvider 的 ID。 此属性为只读。

public:
 property System::String ^ ID { System::String ^ get(); };
public string ID { get; }
member this.ID : string
Public ReadOnly Property ID As String

属性值

返回 LogProvider 的整数 ID。

实现

ID

示例

下面的代码示例加载已启用日志记录的包。 加载包后, LogProviders 将创建集合,并枚举集合中的每个日志提供程序,并打印每个属性的值,包括 GUID 或 ClassID ID

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

namespace LogProvider_Properties_Test  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is one of the SSIS samples,  
            // modified to log information to the "SSIS  
            // log provider for Text files".  
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";  
            // Create the Application, and load the sample.  
            Application app = new Application();  
            Package pkg = app.LoadPackage(mySample, null);  

            // Get the LogProviders collection from the package.  
            LogProviders logProvs = pkg.LogProviders;  
            foreach (LogProvider logProv in logProvs)  
            {  
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString);  
                Console.WriteLine("CreationName    {0}", logProv.CreationName);  
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation);  
                Console.WriteLine("Description     {0}", logProv.Description);  
                Console.WriteLine("HostType        {0}", logProv.HostType);  
                Console.WriteLine("ID              {0}", logProv.ID);  
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject);  
                Console.WriteLine("Name            {0}", logProv.Name);  
             }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.DMQueryTask  

Namespace LogProvider_Properties_Test  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is one of the SSIS samples,  
            ' modified to log information to the "SSIS  
            ' log provider for Text files".  
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.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 from the package.  
            Dim logProvs As LogProviders =  pkg.LogProviders   
            Dim logProv As LogProvider  
            For Each logProv In logProvs  
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString)  
                Console.WriteLine("CreationName    {0}", logProv.CreationName)  
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation)  
                Console.WriteLine("Description     {0}", logProv.Description)  
                Console.WriteLine("HostType        {0}", logProv.HostType)  
                Console.WriteLine("ID              {0}", logProv.ID)  
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject)  
                Console.WriteLine("Name            {0}", logProv.Name)  
            Next  
        End Sub  
    End Class  
End Namespace  

示例输出:

ConfigString:

CreationName DTS。LogProviderTextFile.1

DelayValidation False

说明将事件的日志条目写入 CSV 文件

HostType LogProvider

ID {1E107E39-DB79-4F02-B8A7-61D88F2DEF63}

InnerObject System.__ComObject

为文本文件命名 SSIS 日志提供程序

注解

此属性为只读属性,在将包添加到包时 LogProvider 由运行时分配。 此属性ID是使用该方法时用于将LogProviders集合添加到LogProvider集合的字符串之Add一。 该 ID 也称为 ClassID。 还可以使用 CreationName(也称为 ProgID)将日志提供程序添加到集合。 有关分配给日志提供程序的 ProgID 和 ClassID 的列表,请参阅 Add

适用于