Providers Property
Collapse the table of content
Expand the table of content

ProtectedConfiguration.Providers Property

 

Gets a collection of the installed protected-configuration providers.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public static ProtectedConfigurationProviderCollection Providers { get; }

The following example shows how to use the Providers property to retrieve the collection of installed ProtectedConfigurationProvider objects.

     [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);

         }

     }

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft