i need to delete a registry key here is my code
CODE
Dim i As Integer
i = 1
Dim ii As Integer
ii = 1
Do
Using key As RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("HKEY_LOCAL_MACHINE\SOFTWARE\frontbridgecomputers\snipba\scripts\" & i, True)
Do
If MsgBox("do you wish to delete " & My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\frontbridgecomputers\snipba\scripts\" & i, ii, "") & "?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
key.DeleteValue(ii)
End If
If My.Computer.Registry.LocalMachine.GetValue(ii, "") = "" Then
Exit Do
End If
Loop
End Using
Dim exists As Boolean = False
Try
If My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\frontbridgecomputers\snipba\scripts\" & 1 + 1) IsNot Nothing Then
exists = True
End If
Finally
My.Computer.Registry.CurrentUser.Close()
End Try
If exists = True Then
i = i + 1
Else
If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\frontbridgecomputers\snipba\scripts\" & i, ii + 1, "") = Nothing Then
Exit Do
Else
ii = ii + 1
End If
End If
Loop
any ideas
here is the whole problem
CODE
key.DeleteValue(ii)