H
Henry Fleming
I have an C# assembly that is supposed to read a registry key:
RegistryKey regCurrentUser = Registry.CurrentUser;
RegistryKey regSoftware = regCurrentUser.OpenSubKey("Software",true);
RegistryKey regFamily = regSoftware.OpenSubKey("MyCompany", true);
RegistryKey regApp = regFamily.OpenSubKey("MySystem", true);
RegistryKey regSet = regApp.OpenSubKey("Set0", true);
m_strDSN = (string) regSet.GetValue("DSN", m_strDSN);
The string value "DSN" exists under the registry key
\\HKEY_CURRENT_USER\Software\MyCompany\MySystem\Set0 and definitely
has a value.
This assembly is placed under the /bin subdirectory of my ASP.NET
application. The code executes under the Session_Start event in my
Global.aspx page.
Whenever I start my web application, it doesn't read the registry
setting for the DSN; it always thinks it is null.
I cannot figure out what is wrong. I stepped through the same code on
a different machine and it reads the DSN all right. Help?
Thanks.
RegistryKey regCurrentUser = Registry.CurrentUser;
RegistryKey regSoftware = regCurrentUser.OpenSubKey("Software",true);
RegistryKey regFamily = regSoftware.OpenSubKey("MyCompany", true);
RegistryKey regApp = regFamily.OpenSubKey("MySystem", true);
RegistryKey regSet = regApp.OpenSubKey("Set0", true);
m_strDSN = (string) regSet.GetValue("DSN", m_strDSN);
The string value "DSN" exists under the registry key
\\HKEY_CURRENT_USER\Software\MyCompany\MySystem\Set0 and definitely
has a value.
This assembly is placed under the /bin subdirectory of my ASP.NET
application. The code executes under the Session_Start event in my
Global.aspx page.
Whenever I start my web application, it doesn't read the registry
setting for the DSN; it always thinks it is null.
I cannot figure out what is wrong. I stepped through the same code on
a different machine and it reads the DSN all right. Help?
Thanks.