GetAllSettings Function


GetAllSettings Function

Class

Microsoft.VisualBasic.Interaction

Syntax

     Dim result(,) As String = GetAllSettings  (appname, section) 


appname (required; String)

The name of the application branch to be retrieved.


section (required; String)

The name of the application's subkey that is to be retrieved. This can be a single key or a relative registry path, with path components separated by backslashes.

Description

The GetAllSettings function returns the registry value entry names and their corresponding values for the specified application and section, all as a two-dimensional array. For each entry in the first dimension, entry (x, 0) contains the name, and entry (x, 1) contains its value.

Usage at a Glance

  • GetAllSettings works exclusively with the subkeys of HKEY_CURRENT_USER\Software\VB and VBA ProgramSettings.

  • section is a relative path (similar to that used to describe the directories on a hard drive) used to navigate from the application key to the subkey to be accessed. For example, to access the HKEY_CURRENT_USER\Software\VB and VBA ProgramSettings\RegTester\BranchOne\BranchTwo section, you would use:

         GetAllSettings("RegTester", "BranchOne\BranchTwo") 

  • A call to GetAllSettings will return only the value entry names and data belonging to the final registry key specified by the section argument. If that key itself has one or more subkeys, the data for those subkeys will not be retrieved by the function.

  • If either appname or section do not exist, GetAllSettings returns Nothing.

  • Although the registry supports multiple data types, the GetAllSettings function only supports string values.

  • GetAllSettings cannot be used to access the default value (i.e., the unnamed value entry) belonging to any section. If you're using only the VB registry functions, though, this isn't a serious limitation, since SaveSetting does not allow you to create a default value.

  • Data saved with SaveSetting is placed in the registry on a per-user basis.

  • The .NET Framework includes registry-related features that provide more flexibility than the VB "Settings" functions. These features are found in the Registry and RegistryKey classes of the Microsoft.Win32 namespace.

Version Differences

Visual Basic 2005 includes several new features that let you manage the settings used by an application. Although they are not compatible with the older VB "Settings" functions, they provide a richer set of features. These features are located in the My.Settings object. The My.Computer.Registry object also provides access to convenient registry-related features.

See Also

DeleteSetting Procedure, GetSetting Function, SaveSetting Procedure




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net