共用方式為


SectionInformation.ProtectionProvider 屬性

定義

取得關聯組態區段的受保護之組態提供者。

public:
 property System::Configuration::ProtectedConfigurationProvider ^ ProtectionProvider { System::Configuration::ProtectedConfigurationProvider ^ get(); };
public System.Configuration.ProtectedConfigurationProvider ProtectionProvider { get; }
member this.ProtectionProvider : System.Configuration.ProtectedConfigurationProvider
Public ReadOnly Property ProtectionProvider As ProtectedConfigurationProvider

屬性值

這個 ConfigurationSection 物件的受保護組態提供者。

範例

下列範例示範如何取得 ProtectSection 物件的值 ConfigurationSection

static public void GetProtectionProvider()
{
    SectionInformation sInfo =
        GetSectionInformation();

    ProtectedConfigurationProvider pp = 
        sInfo.ProtectionProvider;
    if (pp == null)
        Console.WriteLine("Protection provider is null");
    else
        Console.WriteLine("Protection provider: {0}", 
            pp.ToString());
}
Public Shared Sub GetProtectionProvider()

    Dim sInfo As SectionInformation = _
    GetSectionInformation()

    Dim pp _
    As ProtectedConfigurationProvider = _
    sInfo.ProtectionProvider
    If pp Is Nothing Then
        Console.WriteLine("Protection provider is null")
    Else
        Console.WriteLine("Protection provider: {0}", _
        pp.ToString())
    End If

End Sub

備註

對於未受保護的區段, ProtectionProvider 屬性為 null

如需受保護組態區段的詳細資訊,請參閱 使用受保護的組態加密組態資訊

適用於

另請參閱