473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2902
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Frankie | last post by:
I'm writing a small utility app (C# Windows forms) used to create new ASP.NET Web sites. This utility needs to be able to change existing values in an existing Web.config. Please note: I do NOT...
2
by: Jarod_24 | last post by:
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...
4
by: jasiglam | last post by:
Using the visual studio.net text editor, I know how to enter/change the "key/value" in the app.config file, for example: key="SqlConnection1.ConnectionString" value="data source=Boomer;initial...
1
by: Joseph Geretz | last post by:
I've been using the following (client-side) configuration block to allow WSE/DIME transfer of files larger than 4 meg: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> (Of...
0
by: Dave A | last post by:
When I register a remoting service programmatically things work great but when I register the service using a config file I get the error "Requested Service not found" when invoking a server...
1
by: Morten71 | last post by:
in web.config in my dot net 1.1 web projects I have my connection strings in the appSettings section. I usually overruled values by referencing an external config file holding my devsettings like...
0
by: BillGatesFan | last post by:
I find this hard to believe but I have put in a good amount of time researching this issue. You mean to tell me I can't create a custom config file and do something like the following: ...
1
by: M Irfan | last post by:
Hello all, Recently I have started working in .NET 2.0. I am developing a web service application that references a DLL component written in C# 2.0. The component has its own config file which...
2
by: Abul Hasan Lakhani | last post by:
Hello This is my first post to this group. I just want to ask that how will I read my connection string from the app.config file in C# 2008 and .Net 3.5. I tried to use System.Configuration...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.