I am trying to read a connection string in the registry for my ASP.NET 4.0 web application.
I've created manually a key in the registry:
The name is ConnectionString, type REG_SZ and data is the connection string.
I set permissions on the registry for read access.
I've tried a few ways to read the key.
Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey = pRegKey.OpenSubKey("SOFTWA
Dim val As Object = pRegKey.GetValue("Setting"
Dim regKey As RegistryKey = Registry.LocalMachine.Open
I get pRegKey = Nothing and regKey = Nothing
What am I missing? How can I make this work.
Any help appreciated.