473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

"Access to the registry key is denied" and OpenRemoteBaseKey

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(Micr osoft.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(Micr osoft.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.
Nov 18 '05 #1
2 4837
I'm curious as to what the exception says after the first example.

Is it possible that you aren't connecting there but the Try...Catch is
eating the exception so you don't see it?
"Jenna" <re*******@yahoo.com> wrote in message
news:dc**************************@posting.google.c om...
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(Micr osoft.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(Micr osoft.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.


Nov 18 '05 #2
Actually, the exception is the same after both examples. I put dummy
code in for the Catch (i.e. sender=sender for the Button1_Click event)
and the code went into the exception in both examples.

On both:
ex.Message = "Access to the registry key is denied"
ex.Source = "mscorlib"
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message news:<eV**************@TK2MSFTNGP12.phx.gbl>...
I'm curious as to what the exception says after the first example.

Is it possible that you aren't connecting there but the Try...Catch is
eating the exception so you don't see it?
"Jenna" <re*******@yahoo.com> wrote in message
news:dc**************************@posting.google.c om...
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(Micr osoft.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(Micr osoft.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.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Frances Del Rio | last post by:
I'm getting Getting "Access is Denied" on resizeTo and moveTo methods in IE (IE 6.0..) I saw two posts about this from 7/6 & 7/7.. I suspect, like previous poster said, that this has to do w/MS...
0
by: Ollie | last post by:
I am getting an Access Denied to COM+ catalog when attempting to save changes.... So I now use impersonation to impersonate an admin account on the machine so that I can create a transients...
4
by: Carlitos | last post by:
Hi there, I got a web application in vb.net that uploads a .zip file to a subfolder inside the root folder of the web application. c:\Inetpub\wwwroot\MyWebApp\uploaddir Then, a c# library...
1
by: Winterminute | last post by:
If I try to make any changes to the ASP.NET Portal Starter kit it fails with an access denied error. This was working when I left last week and is failing today. I don't remember changing...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
0
by: Rico | last post by:
Helolo, I have an ASP.NET application on a Windows 2003 Server machine WITHOUT VS. I am working on an XPPro machine with VS 2003. I have installed the remote debugging components on the server....
1
by: srivatsans101 | last post by:
Hi, I'm trying to access the IFrame contents on a HTML page as frames.document But in IE, I'm getting Access Denied Error Message. I tried to add the IFrame's Src WebSite (a...
0
by: =?Utf-8?B?TW9udGU=?= | last post by:
I am using VB.NET to open and read info from Excel spreadsheets using code similar to this: Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim xlBooks As Excel.Workbooks Dim...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.