Condividi tramite


Visual Basic Concepts

Managing Application Settings

In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.

Visual Basic provides a standard registry location for storing program information for applications created in Visual Basic:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings\appname\section\key

Visual Basic also provides four statements and functions to manipulate the settings stored in your application's registry location.

Function or Statement Description
GetSetting function Retrieves registry settings.
SaveSetting statement Saves or creates registry settings.
GetAllSettings function Returns an array containing multiple registry settings.
DeleteSetting statement Deletes registry settings.

Note   To view registry entries, use the Regedit application, included with Windows 95/98 and Windows NT.

To read more about using application settings, see the following topics: