J
Jenna
In my test form, WebForm1.aspx.vb, this code successfully connects to
the remote registry:
Try
Dim RegTo As Microsoft.Win32.RegistryKey =
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine,
"srvtest")
Catch ex As Exception
End Try
but this code doesn't (RegTo is equal to Nothing):
Dim RegTo As Microsoft.Win32.RegistryKey
Try
RegTo = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine,
"srvtest")
Catch ex As Exception
End Try
As you can see, I just moved the declaration! Does anyone know why
this code does not work? I also have <identity impersonate="true" />
set in the web.config file.
the remote registry:
Try
Dim RegTo As Microsoft.Win32.RegistryKey =
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine,
"srvtest")
Catch ex As Exception
End Try
but this code doesn't (RegTo is equal to Nothing):
Dim RegTo As Microsoft.Win32.RegistryKey
Try
RegTo = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine,
"srvtest")
Catch ex As Exception
End Try
As you can see, I just moved the declaration! Does anyone know why
this code does not work? I also have <identity impersonate="true" />
set in the web.config file.