다음을 통해 공유


CertificateContext 속성

Gets or sets the certificate context.

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

구문

‘선언
<BrowsableAttribute(False)> _
Public Property CertificateContext As Long
    Get
    Set
‘사용 방법
Dim instance As Package
Dim value As Long

value = instance.CertificateContext

instance.CertificateContext = value
[BrowsableAttribute(false)]
public long CertificateContext { get; set; }
[BrowsableAttribute(false)]
public:
property long long CertificateContext {
    long long get ();
    void set (long long value);
}
[<BrowsableAttribute(false)>]
member CertificateContext : int64 with get, set
function get CertificateContext () : long
function set CertificateContext (value : long)

속성 값

유형: System. . :: . .Int64
Returns a Long that contains the certificate context.

주의

You must include a reference to the System.Security.Cryptography.X509Certificates assembly to set the value.

The following example loads a package, and then retrieves several package properties, including the certificate context for the package.

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
    }

Sample Output:

CertificateContext = 0

CheckpointFileName =

ProtectionLevel = EncryptSensitiveWithUserKey

PackageType = Default