Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/03/2011, 07:47
fearhds
 
Fecha de Ingreso: noviembre-2007
Mensajes: 97
Antigüedad: 17 años, 2 meses
Puntos: 0
Pregunta Respuesta: modificar registro de windows

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 original
  1. Imports Microsoft.Win32
  2.     Dim tipo As Integer
  3.     tipo=0
  4.  
  5.    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6.  
  7.      If tipo = 1 Then
  8.  
  9.             MsgBox(tipo)
  10.             Dim ruta As String = "SOFTWARE/Piriform/CCleaner"
  11.             Dim variable As String = "UpdateCheck"
  12.             Dim valor As Object = 1
  13.  
  14.             Try
  15.                 Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(ruta, True)
  16.                 key.SetValue(variable, valor)
  17.             Catch
  18.                 Console.WriteLine("Error.")
  19.             End Try
  20.  
  21.         ElseIf tipo = 2 Then
  22.             MsgBox(tipo)
  23.             Dim ruta As String = "SOFTWARE/Piriform/CCleaner"
  24.             Dim variable As String = "UpdateCheck"
  25.             Dim valor As Object = 0
  26.  
  27.             Try
  28.                 Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(ruta, True)
  29.                 key.SetValue(variable, valor)
  30.             Catch
  31.                 Console.WriteLine("Error.")
  32.             End Try
  33.  
  34.         ElseIf tipo = 3 Then
  35.             MsgBox(tipo)
  36.         Else
  37.             MsgBox("ERROR! Tipo no valido")
  38.         End If
  39.     End Sub
  40. 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