ProtectedConfigurationSection.DefaultProvider Property

Note: This property is new in the .NET Framework version 2.0.

Gets the name of the default ProtectedConfigurationProvider object in the Providers collection property.

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

public string DefaultProvider { get; set; 
/** @property */
public String get_DefaultProvider ()

/** @property */
public void set_DefaultProvider (String value)

public function get DefaultProvider () : String

public function set DefaultProvider (value : String)

Property Value

The name of the default ProtectedConfigurationProvider object in the Providers collection property.

The following code example shows how to use the DefaultProvider property.

static void GetDefaultProvider()
{
    try
    {
        // Get the application configuration.
        Configuration config =
            ConfigurationManager.OpenExeConfiguration(
            ConfigurationUserLevel.None);

        // Get the protected configuration section.
        ProtectedConfigurationSection pcSection =
            (System.Configuration.ProtectedConfigurationSection)
            config.GetSection("configProtectedData");

        // Get the current DefaultProvider.
        Console.WriteLine(
            "Protected configuration section default provider:");
        Console.WriteLine("  {0", pcSection.DefaultProvider);

    
    catch (ConfigurationErrorsException e)
    {
        Console.WriteLine(e.ToString());
    



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.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: