Package.ProtectionLevel Propriedade

Definição

Obtém o nível de proteção do pacote.

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSProtectionLevel ProtectionLevel { Microsoft::SqlServer::Dts::Runtime::DTSProtectionLevel get(); void set(Microsoft::SqlServer::Dts::Runtime::DTSProtectionLevel value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategorySecurity")]
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PackageProtectionLevelDesc")]
public Microsoft.SqlServer.Dts.Runtime.DTSProtectionLevel ProtectionLevel { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategorySecurity")>]
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PackageProtectionLevelDesc")>]
member this.ProtectionLevel : Microsoft.SqlServer.Dts.Runtime.DTSProtectionLevel with get, set
Public Property ProtectionLevel As DTSProtectionLevel

Valor da propriedade

DTSProtectionLevel

Um valor da enumeração DTSProtectionLevel.

Atributos

Exemplos

O exemplo a seguir carrega um pacote e recupera várias propriedades do pacote, incluindo a ProtectionLevel atribuída ao pacote.

Class PackageTest  
    {  
        static void Main(string[] args)  
        {  
            // The variable pkg points to the location of the  
            // ExecuteProcess package sample  
            // installed with the samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p = app.LoadPackage(pkg, null);  

            // Once the package is loaded, this sample can  
           // query on several properties  
            long cc = p.CertificateContext;  
            string cfn = p.CheckpointFileName;  
            DTSProtectionLevel pl = p.ProtectionLevel;  
            DTSPackageType dpt = p.PackageType;  

            Console.WriteLine("CertificateContext = " + cc);  
            Console.WriteLine("CheckpointFileName = " + cfn);  
            Console.WriteLine("ProtectionLevel = " + pl);  
            Console.WriteLine("PackageType = " + dpt);  
        }  
    }  
Class PackageTest  
    {  
        Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location of the  
            ' ExecuteProcess package sample  
            ' installed with the samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p As Package =  app.LoadPackage(pkg,Nothing)   

            ' Once the package is loaded, this sample can  
           ' query on several properties  
            Dim cc As Long =  p.CertificateContext   
            Dim cfn As String =  p.CheckpointFileName   
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel   
            Dim dpt As DTSPackageType =  p.PackageType   

            Console.WriteLine("CertificateContext = " + cc)  
            Console.WriteLine("CheckpointFileName = " + cfn)  
            Console.WriteLine("ProtectionLevel = " + pl)  
            Console.WriteLine("PackageType = " + dpt)  
        End Sub  
    }  

Saída de exemplo:

CertificateContext = 0

CheckpointFileName =

ProtectionLevel = EncryptSensitiveWithUserKey

PackageType = Default

Comentários

Para obter mais informações sobre como definir níveis de proteção de pacote, consulte 存取控制 para dados confidenciais em pacotes.

Aplica-se a