Creating a custom .Config file

  • Thread starter Thread starter Jarod_24
  • Start date Start date
J

Jarod_24

I Created a .config file for my Web application and named it
"Settings.config"

The file contains some settings for the application, including a connection
string to a database.

But i don't see how a System.Configuration. class finds the file.

I expected to be doing something like this:

'I just use 'AppSettingsReader' as an example here

Dim k as New system.Configuration.AppSettingsReader
k.Filename = mypath & "Settings.config"

Dim s As String = CType( k.GetValue("Connectionstring"), String)

But i don't find a .Filename property, and that tells me that you can only
use these Classes with the 'standard' .config files. The files that .Net
expect to be there; Like machine.config and maybe web.config.

How do i get to read values from my Custom .config file?
 
Paul Wistrand said:
Why not just use web.config?

Maybe i'm just weird, but i'd prefer to have my own custom .config file, and
not start mixing up these things with all the generic .net settings that are
in there.
 
Back
Top