Click here to Skip to main content
15,915,065 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to delete this key but how .

This is how i read the key , how to delete this ?
VB
Dim readValue As String
        readValue = My.Computer.Registry.GetValue _
        ("HKEY_CURRENT_USER\Software\VB and VBA Program Settings\TestKey", "TestValue", Nothing)
        Label1.Text = readValue


this is not working.

VB
Try
           Dim key As Microsoft.Win32.RegistryKey
           key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\VB and VBA Program Settings\TestKey", True)

           key.DeleteValue("TestValue")
       Catch ex As Exception

       End Try
Posted
Updated 9-Apr-13 23:46pm
v3

Hi,

try by using "DeleteSubKey" method.
VB
key.DeleteSubKey("TestValue")

refer RegistryKey.DeleteSubKey Method [^]

hope it helps.
 
Share this answer
 
Use DeleteSubKey[^]. Check this: http://geekswithblogs.net/BruceEitman/archive/2009/07/26/c--deleting-a-registry-key.aspx[^] (example is c#, but quite obvious in vb.net too)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900