Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

LocalFileSettingsProvider Class

Provides persistence for application settings classes.

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

public class LocalFileSettingsProvider : SettingsProvider, IApplicationSettingsProvider
public class LocalFileSettingsProvider extends SettingsProvider implements IApplicationSettingsProvider
public class LocalFileSettingsProvider extends SettingsProvider implements IApplicationSettingsProvider
Not applicable.

Setting providers define a mechanism for storing configuration data used in the application settings architecture. The .NET Framework contains a single default settings provider, LocalFileSettingsProvider, which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the SettingsProviderAttribute.

Typically, the client program does not explicitly access this class; rather, the application settings architecture automatically invokes the appropriate settings provider when its services are required. For example, many of the members of ApplicationSettingsBase delegate their work to the associated settings provider.

LocalFileSettingsProvider persists settings to configuration files that have the extension .config. The contents of configuration files are structured as XML documents. Depending on whether the setting is scoped at either the application-level or user-level, the configuration data is stored as elements within an <applicationSettings> or a <userSettings> section group, respectively. Each of these section groups is represented by a corresponding AppSettingsSection or ClientSettingsSection, respectively. Each section object is owned and administered by a configuration section handler, which is an object of type IConfigurationSectionHandler.

Application-scoped settings and the default user-scoped settings are stored in a file named application.exe.config, which is created in the same directory as the executable file. Application configuration settings are read-only. Specific user data is stored in a file named username.config, stored under the user's home directory. If roaming profiles are enabled, two versions of the user configuration file could exist. In such a case, the entries in the roaming version take precedence over duplicated entries in the local user configuration file.

For more information about application settings, see Application Settings for Windows Forms.

System.Object
   System.Configuration.Provider.ProviderBase
     System.Configuration.SettingsProvider
      System.Configuration.LocalFileSettingsProvider

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft