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

注解

对于未受保护的部分,属性 ProtectionProvidernull

有关受保护的配置部分的详细信息,请参阅 使用受保护的配置加密配置信息

适用于

另请参阅