views:

641

answers:

1

I get a null back from this attempt to access the Windows Registry:

using (RegistryKey registry = Registry.LocalMachine.OpenSubKey(keyPath))

keyPath is SOFTWARE\\TestKey

The key is in the registry, so I do not know why it's not finding it under Local Machine hive.

A: 

in your comment to Dana you said you gave the asp.net account access, however did you verify that that is the account that the site in running under? Impersonate and the anonymous access user can be easy to overlook.

UNTESTED CODE:

Response.Clear();  
Response.Write(Environment.UserDomainName + "\\" + Environment.UserName);  
Response.End();
Christopher Kelly
How can I figure out which account the site is running under without having to write code to expose?
CoffeeAddict
well the above is generally how i troubleshoot account issues although i do add a check in that it is coming from my ip address so that not just everyone can see it.
Christopher Kelly