Partilhar via


ProtectedConfiguration.Providers Propriedade

Definição

Obtém uma coleção de provedores de configuração protegidos instalados.

public:
 static property System::Configuration::ProtectedConfigurationProviderCollection ^ Providers { System::Configuration::ProtectedConfigurationProviderCollection ^ get(); };
public static System.Configuration.ProtectedConfigurationProviderCollection Providers { get; }
static member Providers : System.Configuration.ProtectedConfigurationProviderCollection
Public Shared ReadOnly Property Providers As ProtectedConfigurationProviderCollection

Valor da propriedade

Uma ProtectedConfigurationProviderCollection coleção de objetos instalados ProtectedConfigurationProvider .

Exemplos

O exemplo a seguir mostra como usar a Providers propriedade para recuperar a coleção de objetos instalados 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

Aplica-se a

Confira também