Package.CertificateContext Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta l'oggetto certificato X.509 per il pacchetto.
public:
property long CertificateContext { long get(); void set(long value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "CertificateContextDesc")]
[System.ComponentModel.Browsable(false)]
public long CertificateContext { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "CertificateContextDesc")>]
[<System.ComponentModel.Browsable(false)>]
member this.CertificateContext : int64 with get, set
Public Property CertificateContext As Long
Valore della proprietà
Oggetto certificato X.509 per il pacchetto.
- Attributi
Esempio
Nell'esempio seguente viene caricato un pacchetto e quindi vengono recuperate diverse proprietà del pacchetto, incluso il contesto del certificato per il pacchetto.
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
}
Esempio di output
CertificateContext = 0
CheckpointFileName =
ProtectionLevel = EncryptSensitiveWithUserKey
PackageType = Default
Commenti
Per impostare il valore, è necessario includere un riferimento all'assembly System.Security.Cryptography.X509Certificates .