Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/04/2007, 03:57
sser07
 
Fecha de Ingreso: marzo-2007
Mensajes: 8
Antigüedad: 17 años, 1 mes
Puntos: 0
Error: System.NullReferenceException

Resulta que he creado un form que quita a las dos opciones:
El problema biene cuando lo hace funcionar un usuario que no es administrador.
Me da el error que os he puesto al final:.....

Shell("reg add hkcu\software\microsoft\windows\currentversion\pol icies\system /v disabletaskmgr /t reg_dword /d ""1"" /f")


Dim regkey As Microsoft.Win32.RegistryKey
regkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey( _
"software\microsoft\windows\currentversion\policie s\system", True)
regkey.SetValue("NoDispCPL", 1)
regkey.Close()


ESTE ES EL ERROR QUE ME DA... COMO ADMINISTRADOR FUNCIONA BIEN.

Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
en Carga.Cancel.Cancel_Load(Object sender, EventArgs e)
en System.EventHandler.Invoke(Object sender, EventArgs e)
en System.Windows.Forms.Form.OnLoad(EventArgs e)
en System.Windows.Forms.Form.OnCreateControl()
en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
en System.Windows.Forms.Control.CreateControl()
en System.Windows.Forms.Control.WmShowWindow(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
en System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
en System.Windows.Forms.Form.WmShowWindow(Message& m)
en System.Windows.Forms.Form.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Ensamblados cargados **************
mscorlib
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Carga
Versión del ensamblado: 1.0.0.0
Versión Win32: 1.0.0.0
Código base: file:///C:/Archivos%20de%20programa/Silev/Silev/Carga.exe
----------------------------------------
Microsoft.VisualBasic
Versión del ensamblado: 8.0.0.0
Versión Win32: 8.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
mscorlib.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.42 (RTM.050727-4200)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada

Por ejemplo:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.