Stores the current values of the application settings properties.
Assembly: System (in System.dll)
The method writes the current value of each settings property to its associated data store. For each property, this method calls the SetPropertyValues method on the associated settings provider.
This method differs from the base class implementation in that it raises the SettingsSaving event before the values are written.
If the only settings defined are application-scoped settings, will have no effect and return no error if called with the default LocalFileSettingsProvider. LocalFileSettingsProvider only saves user-scoped settings.
There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the method to persist the current values of the application settings. This is typically performed in the Closing event handler of the primary or containing Form.
The following code example shows the method being called from the Closing event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's Text property.
The full code example is listed in the ApplicationSettingsBase class overview.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.