ProtectedConfiguration.Providers 属性  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取安装的受保护配置提供程序的集合。
public:
 static property System::Configuration::ProtectedConfigurationProviderCollection ^ Providers { System::Configuration::ProtectedConfigurationProviderCollection ^ get(); };public static System.Configuration.ProtectedConfigurationProviderCollection Providers { get; }static member Providers : System.Configuration.ProtectedConfigurationProviderCollectionPublic Shared ReadOnly Property Providers As ProtectedConfigurationProviderCollection属性值
安装的 ProtectedConfigurationProviderCollection 对象的 ProtectedConfigurationProvider 集合。
示例
以下示例演示如何使用 Providers 属性检索已安装 ProtectedConfigurationProvider 对象的集合。
   [PermissionSet(SecurityAction.Demand, Name="FullTrust")]    
private static void GetProviders()
   {
       // Get the providers' collection.
       ProtectedConfigurationProviderCollection
           providers = ProtectedConfiguration.Providers;
       IEnumerator pEnum =
           providers.GetEnumerator();
       foreach (ProtectedConfigurationProvider provider in
           providers)
       {
           Console.WriteLine
               ("Provider name: {0}",
                 provider.Name);
           Console.WriteLine
                    ("Provider description: {0}",
                     provider.Description);
       }
   }
<PermissionSet( _
 SecurityAction.Demand, Name:="FullTrust")> _
 Private Shared Sub GetProviders()
   ' Get the providers' collection.
     Dim providers _
     As ProtectedConfigurationProviderCollection = _
     ProtectedConfiguration.Providers
   
     Dim pEnum As IEnumerator = _
     providers.GetEnumerator()
   
     Dim provider _
     As ProtectedConfigurationProvider
     For Each provider In providers
         Console.WriteLine( _
         "Provider name: {0}", provider.Name)
         Console.WriteLine( _
         "Provider description: {0}", provider.Description)
     Next provider
End Sub