VB.NET Language in a Nutshell

   
DeleteSetting Procedure

Class

Microsoft.VisualBasic.Interaction

Syntax

DeleteSetting( appname [, section [, key ]])

appname (required; String)

The name of the application. This must be a subkey of the HKEY_CURRENT_ USER \Software\VB and VBA Program Settings registry key.

section (optional; String)

The name of the application key's subkey that is to be deleted. section can be a single key or a registry path separated with backslashes.

key (optional; String)

The name of the value entry to delete.

Description

Deletes a complete application key, one of its subkeys, or a single value entry from the Windows registry

Rules at a Glance

Example

Sub TestTheReg( ) SaveSetting("MyRealGoodApp", _ "TestBranch\SomeSection\AnotherSection", _ "Testkey", "10") MsgBox("Now look in RegEdit") End Sub Sub TestDelete( ) If GetSetting("MyRealGoodApp", _ "TestBranch\SomeSection\AnotherSection", _ "TestKey") <> "" Then DeleteSetting("MyRealGoodApp", _ "TestBranch\SomeSection\AnotherSection", _ "TestKey") MsgBox("Look again!") End If End Sub

Programming Tips and Gotchas

See Also

GetAllSettings Function, GetSetting Function, SaveSetting Procedure

   

Категории