ProtectedConfigurationProviderCollection 类

定义

提供 ProtectedConfigurationProvider 对象的集合。Provides a collection of ProtectedConfigurationProvider objects.

public ref class ProtectedConfigurationProviderCollection : System::Configuration::Provider::ProviderCollection
public class ProtectedConfigurationProviderCollection : System.Configuration.Provider.ProviderCollection
type ProtectedConfigurationProviderCollection = class
    inherit ProviderCollection
Public Class ProtectedConfigurationProviderCollection
Inherits ProviderCollection
继承
ProtectedConfigurationProviderCollection

注解

ProtectedConfigurationProviders的属性是ProtectedConfigurationProviderCollection可用于应用程序的所有受保护配置提供程序的集合。The Providers property of the ProtectedConfiguration class is a ProtectedConfigurationProviderCollection collection of all protected-configuration providers available to your application.

你可以对配置文件的各个部分进行加密, 以保护你的应用程序使用的敏感信息。You can encrypt sections of a configuration file to protect sensitive information used by your application. 即使攻击者获取了对配置文件的访问权限, 这也会使未经授权的访问更难提高安全性。This improves security by making unauthorized access difficult, even if an attacker gains access to your configuration file.

.NET Framework 包括两个受保护的配置提供程序, 这些提供程序可用于对配置文件中RsaProtectedConfigurationProvider的节进行加密: RSACryptoServiceProvider类, 该类使用类来加密DpapiProtectedConfigurationProvider配置节和类, 该类使用 Windows 数据保护 API (DPAPI) 加密配置节。The .NET Framework includes two protected configuration providers that can be used to encrypt sections of a configuration file: the RsaProtectedConfigurationProvider class, which uses the RSACryptoServiceProvider class to encrypt configuration sections, and the DpapiProtectedConfigurationProvider class, which uses the Windows Data Protection API (DPAPI) to encrypt configuration sections.

可能要求使用 RSA 或 DPAPI 提供程序以外的算法来加密敏感信息。You might have a requirement to encrypt sensitive information using an algorithm other than the RSA or DPAPI providers. 在这种情况下, 您可以生成自己的自定义受保护的配置提供程序。In this case, you can build your own custom protected-configuration provider. ProtectedConfigurationProvider类是一个抽象基类, 你必须从继承该类才能创建自己的受保护的配置提供程序。The ProtectedConfigurationProvider class is an abstract base class that you must inherit from to create your own protected-configuration provider.

有关受保护配置的详细信息, 请参阅使用受保护的配置加密配置信息For more information about protected configuration, see Encrypting Configuration Information Using Protected Configuration.

构造函数

ProtectedConfigurationProviderCollection()

使用默认设置初始化 ProtectedConfigurationProviderCollection 类的新实例。Initializes a new instance of the ProtectedConfigurationProviderCollection class using default settings.

属性

Count

获取集合中提供程序的数目。Gets the number of providers in the collection.

(继承自 ProviderCollection)
IsSynchronized

获取一个值,该值指示对集合的访问是否为同步的(线程安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

(继承自 ProviderCollection)
Item[String]

获取集合中具有指定名称的 ProtectedConfigurationProvider 对象。Gets a ProtectedConfigurationProvider object in the collection with the specified name.

SyncRoot

获取当前对象。Gets the current object.

(继承自 ProviderCollection)

方法

Add(ProviderBase)

ProtectedConfigurationProvider 对象添加到集合中。Adds a ProtectedConfigurationProvider object to the collection.

Clear()

从集合中移除所有项。Removes all items from the collection.

(继承自 ProviderCollection)
CopyTo(ProviderBase[], Int32)

从指定索引处开始,将集合中的内容复制到给定数组。Copies the contents of the collection to the given array starting at the specified index.

(继承自 ProviderCollection)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

返回一个对象,该对象实现 IEnumerator 接口以循环访问集合。Returns an object that implements the IEnumerator interface to iterate through the collection.

(继承自 ProviderCollection)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Remove(String)

从集合中移除提供程序。Removes a provider from the collection.

(继承自 ProviderCollection)
SetReadOnly()

将集合设置为只读。Sets the collection to be read-only.

(继承自 ProviderCollection)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

ProviderCollection 的元素复制到一个数组中从特定的数组索引开始的位置。Copies the elements of the ProviderCollection to an array, starting at a particular array index.

(继承自 ProviderCollection)

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅