ProviderSettingsCollection Class
.NET Framework 2.0
Note: This class is new in the .NET Framework version 2.0.
Represents a collection of ProviderSettings objects.
Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)
Assembly: System.Configuration (in system.configuration.dll)
The following code example shows how to iterate through the Providers property, which returns a ProviderSettingsCollection.
using System; using System.Collections; using System.Collections.Specialized; using System.Text; using System.Configuration; namespace Samples.AspNet.Configuration { // Show how to use a custom protected configuration // provider. public class UsingProviderSettings { private static void GetProviderSettings() { // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); ProtectedConfigurationSection pSection = config.GetSection("protectedData") as ProtectedConfigurationSection; ProviderSettingsCollection providerSettings = pSection.Providers; foreach (ProviderSettings pSettings in providerSettings) { Console.WriteLine( "Provider settings name: {0", pSettings.Name); Console.WriteLine( "Provider settings type: {0", pSettings.Type); NameValueCollection parameters = pSettings.Parameters; IEnumerator pEnum = parameters.GetEnumerator(); int i = 0; while (pEnum.MoveNext()) { string pLength = parameters[i].Length.ToString(); Console.WriteLine( "Provider ssettings: {0 has {1 parameters", pSettings.Name, pLength); static void Main(string[] args) { GetProviderSettings();
System.Object
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Configuration.ProviderSettingsCollection
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Configuration.ProviderSettingsCollection
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.