He probado lo que me dices pero me dice que hay un error.
te pego el codigo a ver si me puedes ayudar :D
Código vb:
Ver originalImports Microsoft.Win32
Dim tipo As Integer
tipo=0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If tipo = 1 Then
MsgBox(tipo)
Dim ruta As String = "SOFTWARE/Piriform/CCleaner"
Dim variable As String = "UpdateCheck"
Dim valor As Object = 1
Try
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(ruta, True)
key.SetValue(variable, valor)
Catch
Console.WriteLine("Error.")
End Try
ElseIf tipo = 2 Then
MsgBox(tipo)
Dim ruta As String = "SOFTWARE/Piriform/CCleaner"
Dim variable As String = "UpdateCheck"
Dim valor As Object = 0
Try
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(ruta, True)
key.SetValue(variable, valor)
Catch
Console.WriteLine("Error.")
End Try
ElseIf tipo = 3 Then
MsgBox(tipo)
Else
MsgBox("ERROR! Tipo no valido")
End If
End Sub
End Class
Copiando el archivo de "obj\x86\Debug\PRUEBA.exe" en "bin\Debug\PRUEBA.exe".
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Micr osoft.Common.targets(2868,9): error MSB3021: No se puede copiar "obj\x86\Debug\PRUEBA.exe" en "bin\Debug\PRUEBA.exe". El proceso no puede obtener acceso al archivo 'bin\Debug\PRUEBA.exe' porque está siendo utilizado en otro proceso.
ERROR al compilar.
alguna idea de como solucionarlo?
gracias de antemano