468,306 Members | 1,269 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,306 developers. It's quick & easy.

Reading a custom ".config" file programmatically

Hello All,

I have created my own custom configuration file. I would like to know about
API available to read that config file. Since config file is nothing but an
XML file, I could definitetly use the XML Dom API. But are there any other
options because I see that for example to read a setting called as
"Connectionstring" in web.config we use .......
System.Configuration.ConfigurationSettings.AppSett ings["ConnectionString"];
Similarly how can I use this to read from a custom config file?

Thanks for suggestions!!!
Nov 19 '05 #1
1 2667
Diffident wrote:
Hello All,

I have created my own custom configuration file. I would like to know about
API available to read that config file. Since config file is nothing but an
XML file, I could definitetly use the XML Dom API. But are there any other
options because I see that for example to read a setting called as
"Connectionstring" in web.config we use .......
System.Configuration.ConfigurationSettings.AppSett ings["ConnectionString"];
Similarly how can I use this to read from a custom config file?

Thanks for suggestions!!!


Create a custom class called MyConfig and simply parse in the
"settings", as you mentioned they are just XML, then you can simply
point to YourApp.MyConfig.blah for the value. Use a simple Get/Set to
access.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Frankie | last post: by
2 posts views Thread by Jarod_24 | last post: by
reply views Thread by BillGatesFan | last post: by
1 post views Thread by M Irfan | last post: by
2 posts views Thread by Abul Hasan Lakhani | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.