Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
public: static void SaveSetting ( String^ AppName, String^ Section, String^ Key, String^ Setting )
public static void SaveSetting ( String AppName, String Section, String Key, String Setting )
public static function SaveSetting ( AppName : String, Section : String, Key : String, Setting : String )
Required. String expression containing the name of the application or project to which the setting applies.
Required. String expression containing the name of the section in which the key setting is being saved.
Required. String expression containing the name of the key setting being saved.
Required. Expression containing the value to which Key is being set.
For more detailed information, see the Visual Basic topic SaveSetting Function.
The SaveSetting function adds the key to HKEY_CURRENT_USER\Software\VB and VBA Program Settings.
If the key setting cannot be saved for any reason, an error occurs.
SaveSetting requires that a user be logged on since it operates under the HKEY_LOCAL_USER registry key, which is not active until a user logs on interactively.
Registry settings that are to be accessed from a non-interactive process (such as Mtx.exe) should be stored under either the HKEY_LOCAL_MACHINE\Software\ or the HKEY_USER\DEFAULT\Software registry keys.
SaveSetting requires Write and CreateRegistry Permission.
The following example first uses the SaveSetting function to make entries in the Windows registry for the MyApp application, and then uses the DeleteSetting function to remove them.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.