LocalFileSettingsProvider.Reset(SettingsContext) 方法

定义

将与指定的应用程序关联的所有应用程序设置属性重置为其默认值。Resets all application settings properties associated with the specified application to their default values.

public:
 virtual void Reset(System::Configuration::SettingsContext ^ context);
public void Reset (System.Configuration.SettingsContext context);
abstract member Reset : System.Configuration.SettingsContext -> unit
override this.Reset : System.Configuration.SettingsContext -> unit
Public Sub Reset (context As SettingsContext)

参数

context
SettingsContext

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

实现

例外

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

注解

Reset方法还原指定应用程序设置组的存储值。The Reset method restores the stored values of the specified application settings group. 的操作 Reset 取决于应用程序设置属性的作用域:The action of Reset depends on the scope of the application settings property:

  • 应用程序范围的设置不受影响。Application-scoped settings are not affected.

  • 用户范围的设置将重置为在应用程序配置文件中存储为只读条目的默认值 application.exe.configUser-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, application.exe.config. 如果使用漫游配置文件,则漫游配置文件中的任何应用程序设置值都优先于在本地配置文件中找到的重复项。If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile.

请注意,如果使用漫游配置文件,则可以有两个 user.config 文件,一个用于本地设置,另一个用于漫游配置文件。Notice that if roaming profiles are used, there can be two user.config files, one for the local settings and one for the roaming profile.

适用于

另请参阅