ProtectedConfigurationProviderCollection 类

定义

提供 ProtectedConfigurationProvider 对象的集合。

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

注解

Providers类的 ProtectedConfiguration 属性是ProtectedConfigurationProviderCollection应用程序可用的所有受保护配置提供程序的集合。

可以加密配置文件的各个部分,以保护应用程序使用的敏感信息。 这提高了安全性,使未经授权的访问变得困难,即使攻击者获得了对配置文件的访问权限。

.NET Framework包括两个受保护的配置提供程序,可用于加密配置文件的节:RsaProtectedConfigurationProvider类(使用 RSACryptoServiceProvider 类加密配置部分)和DpapiProtectedConfigurationProvider类(使用 Windows 数据保护 API (DPAPI) 加密配置节)。

可能需要使用 RSA 或 DPAPI 提供程序以外的算法来加密敏感信息。 在这种情况下,可以生成自己的自定义受保护配置提供程序。 类 ProtectedConfigurationProvider 是一个抽象基类,必须继承该基类才能创建自己的受保护配置提供程序。

有关受保护配置的详细信息,请参阅 使用受保护的配置加密配置信息

构造函数

ProtectedConfigurationProviderCollection()

使用默认设置初始化 ProtectedConfigurationProviderCollection 类的新实例。

属性

Count

获取集合中提供程序的数目。

(继承自 ProviderCollection)
IsSynchronized

获取一个值,该值指示对集合的访问是否为同步的(线程安全)。

(继承自 ProviderCollection)
Item[String]

获取集合中具有指定名称的 ProtectedConfigurationProvider 对象。

SyncRoot

获取当前对象。

(继承自 ProviderCollection)

方法

Add(ProviderBase)

ProtectedConfigurationProvider 对象添加到集合中。

Clear()

从集合中移除所有项。

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

从指定索引处开始,将集合中的内容复制到给定数组。

(继承自 ProviderCollection)
Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetEnumerator()

返回一个对象,该对象实现 IEnumerator 接口以循环访问集合。

(继承自 ProviderCollection)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
Remove(String)

从集合中移除提供程序。

(继承自 ProviderCollection)
SetReadOnly()

将集合设置为只读。

(继承自 ProviderCollection)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

显式接口实现

ICollection.CopyTo(Array, Int32)

ProviderCollection 的元素复制到一个数组中从特定的数组索引开始的位置。

(继承自 ProviderCollection)

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。

AsParallel(IEnumerable)

启用查询的并行化。

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryable

适用于

另请参阅