Pointing to registry from Web.config file

  • Thread starter Thread starter Adnan Selimovic
  • Start date Start date
A

Adnan Selimovic

Hi folks! I have Framework 1.0 installed and I would like to point to
registry from my Web.config file:

<connectionString>
<add key="password" value="registry:HKLM\Software\Foo,password" />
<add key="userID" value="registry:HKLM\Software\Foo,userID" />
<add key="initialCatalog"
value="registry:HKLM\Software\Foo,initialCatalog" />
<add key="dataSource" value="registry:HKLM\Software\Foo,dataSource" />
<add key="integratedSecurity"
value="registry:HKLM\Software\Foo,integratedSecurity" />
</connectionString>

When I read the values using the ConfigurationSettings.GetConfig method I
get the value entered in the config file and not the one in the registry.
Do I need to have a patch mentioned in the KB 329259 to have this work?

Cheers,

Adnan
 
Configuration.GetConfig method reads the contents of the web.config file.
If you want to read from the Windows registry, you will need to implement
your own code.
 
Back
Top