473,779 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HKCU Registry Hive & ASP.NET impersonated application

Hello everybody!

There are many posts here concerning registry access and some derived problems.
I couldn't find however any simple answer to this basic question:

How can an impersonifited ASP.NET application access the HKCU registry hive of the user on whose behalf it runs?

It is obvious that that hive is not automatically loaded, thus what method does Microsoft recommend to load it so that my APS application can refer to HKCU?

I am using a third-party DLL (.NET) which keeps some data in the registry on per-user basis and I cannot change this design. That DLL works perfectly for its authors because they build desktop applications.

Any help, hints and ideas appreciated
Robert Drozdz
Nov 18 '05 #1
1 1607
Robert,

HKCU will not be populated for your target user because the execution
context is a service. This will continue to be a problem regardless of
whether you authenticate the user via IIS or ASP.NET.

Instead of trying to get the data out of HKCU, have you considered trying
to read for HKU? See http://www.codeproject.com/dotnet/ntsecuritynet.asp
for help on mapping the WindowsIdentity token to an SID string for use in
identifying the correct subky of HKU.

HTH,
Nicole
"Robert Drozdz" <Robert Dr****@discussi ons.microsoft.c om> wrote in message
news:BC******** *************** ***********@mic rosoft.com...
Hello everybody!

There are many posts here concerning registry access and some derived
problems.
I couldn't find however any simple answer to this basic question:

How can an impersonifited ASP.NET application access the HKCU registry
hive of the user on whose behalf it runs?

It is obvious that that hive is not automatically loaded, thus what method
does Microsoft recommend to load it so that my APS application can refer
to HKCU?

I am using a third-party DLL (.NET) which keeps some data in the registry
on per-user basis and I cannot change this design. That DLL works
perfectly for its authors because they build desktop applications.

Any help, hints and ideas appreciated
Robert Drozdz

Nov 18 '05 #2

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

Similar topics

2
15076
by: Brian Campbell | last post by:
Gretings... I have written a Windows Service that accesses a Web Service. Both run fine on my development machine.... After installing both the Windows Service and Web Service on my staging server, I get the following error...
21
10834
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing System.SecurityException. Also of note: Sitting at my local box, I can open regedit and connect to the remote registry. I see three hives: _CLASSES_ROOT, _LOCAL_MACHINE, and _USERS. I can open all but HKEY_LOCAL_MACHINE. When I try to expand that...
4
5437
by: Viviana Vc | last post by:
Hi all, A Windows service (which obviously starts before any user logs in) is failing to: - read something from registry from a key under the HKCU - try to find out the user path by doing the following call: SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path) if any of these is tried before a user logs in. My question is: are these 2:
3
1533
by: techmaccoy | last post by:
I am trying to access a entry under HKEY_Current_USER/Software. In My code it List seven subkeys under there. Actually there are lot more and the entry i wanted to access in seen in the Registry, but not listed in my code. I checked under the HKEY_USERS Key there are many users listed. and each have a Software entry. The list i get through my ASPCode belongs to one of the user. But the entry i a m seeking is under a different User.
8
2048
by: MSDN Account | last post by:
I have looked at the documentation for 'Microsoft.Win32.Registry' and 'System.Security.Permissions.RegistryPermission' but am still stuck, hoping some can give me a nudge in the right direction. I would like to be able to modify the GPO Policy keys under HKCU for the logged user from an application. Because they are read only to the user can I prompt for an ID and PW (say a support tech) that can be used to access the keys with...
8
4639
by: Shawn B. | last post by:
Greetings, I'm creating a little program that acts as a glorified Registry explorer. The TreeView doesn't allow you to show a plus sign unless a node has child nodes, so I need to determine whether a registry key has subkeys and add a dummy childnode. The way I'm doing this is to populate the child nodes as the parent is expanded. However, there are some serious performance implications. First, when I pouplate the HKEY_CLASSES_ROOT,...
2
263
by: Mr. Novice | last post by:
A co-worker and I are collaborating on a vb.net app that automates some of the processes our team uses. We wrote preferences for the application that are stored in the registry. Problem that the preferences are not stored unless the users have admin rights to their workstations. I know that many applications store information in the registry and are able to do this without the users having admin rights to the workstations. So the...
0
4005
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain, but my department has a couple of web servers of our own that are part of my organization's domain. I am trying to read LDAP information on my organization's domain controller from a web application on one of my department's servers. I have been...
11
7552
by: Unknown Hero | last post by:
Tim Golden wrote: The first link which points to the Python documentation for the _winreg module I already checked, even before coming here. I am wondering how I should do the loop I need (go through HKEY_LOCAL_MACHINE and read one subkey at a time, if it contains this 'foo' then change it into 'moo'). As I already said, I am by no means an expert in Python (heck, I learned the basics only a month ago). However, I am willing to learn.
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10137
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9928
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7483
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.