LocalFileSettingsProvider.GetPropertyValues(SettingsContext, SettingsPropertyCollection) 方法

定义

为指定的应用程序实例和设置属性组返回设置属性值的集合。Returns the collection of setting property values for the specified application instance and settings property group.

public:
 override System::Configuration::SettingsPropertyValueCollection ^ GetPropertyValues(System::Configuration::SettingsContext ^ context, System::Configuration::SettingsPropertyCollection ^ properties);
public override System.Configuration.SettingsPropertyValueCollection GetPropertyValues (System.Configuration.SettingsContext context, System.Configuration.SettingsPropertyCollection properties);
override this.GetPropertyValues : System.Configuration.SettingsContext * System.Configuration.SettingsPropertyCollection -> System.Configuration.SettingsPropertyValueCollection
Public Overrides Function GetPropertyValues (context As SettingsContext, properties As SettingsPropertyCollection) As SettingsPropertyValueCollection

参数

context
SettingsContext

描述当前应用程序用法的 SettingsContextA SettingsContext describing the current application usage.

properties
SettingsPropertyCollection

一个包含设置属性组(将要检索该组中的值)的 SettingsPropertyCollectionA SettingsPropertyCollection containing the settings property group whose values are to be retrieved.

返回

一个包含指定设置属性组的值的 SettingsPropertyValueCollectionA SettingsPropertyValueCollection containing the values for the specified settings property group.

例外

遇到了用户范围的设置,但是当前的配置仅支持应用程序范围的设置。A user-scoped setting was encountered but the current configuration only supports application-scoped settings.

注解

GetPropertyValues 方法还管理 ConnectionString的特殊应用程序设置类型。The GetPropertyValues method also manages the special application settings type ConnectionString. 连接字符串存储在配置文件中由 <connectionstrings>元素分隔的特定部分。Connection strings are stored in a special section of the configuration file delimited by the element <connectionstrings>.

注意

LocalFileSettingsProvider 不使用加密来保留任何设置。LocalFileSettingsProvider does not use encryption to persist any settings. 因此,请不要使用此提供程序存储纯文本密码或其他敏感信息,而无需采取其他防范措施,例如,在配置文件中单独加密信息。Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. 有关详细信息,请参阅使用受保护的配置加密配置信息For more information, see Encrypting Configuration Information Using Protected Configuration.

适用于

另请参阅