473,569 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Correct way of reading another application's configuration file

Hi, whats the correct way of opening up a different applications
configuration file?

i.e. i want to open someotherapp.ex e.config and read the settings
contained in "applicationSet tings".

Ive done the following code, but i dont if its the correct method
(doesnt take any form of security into account):

Configuration config = ConfigurationMa nager.OpenExeCo nfiguration(pat h);
ConfigurationSe ctionGroup configSectionGr oup =
config.GetSecti onGroup("applic ationSettings") ;
Im using .NET 2.0.

Thanks
Jan 31 '06 #1
2 9804
Hello, Mark!

MI> i.e. i want to open someotherapp.ex e.config and read the settings
MI> contained in "applicationSet tings".

MI> Ive done the following code, but i dont if its the correct method
MI> (doesnt take any form of security into account):

MI> Configuration config = ConfigurationMa nager.OpenExeCo nfiguration(pat h);
MI> ConfigurationSe ctionGroup configSectionGr oup =
MI> config.GetSecti onGroup("applic ationSettings") ;

MI> Im using .NET 2.0.

I'm no sure but ConfigurationMa nager can open file for exclusive read or write access. It is not good since original application may write smth to the config.

If you want to read some data from config file and that config is Xml, imo it will be more efficient to do it manually.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Jan 31 '06 #2
Hi,

The config file is in XML format, you can read it as any other XML file.

You have to make sure that it's not in use though.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mark Ingram" <no****@nowhere .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi, whats the correct way of opening up a different applications
configuration file?

i.e. i want to open someotherapp.ex e.config and read the settings
contained in "applicationSet tings".

Ive done the following code, but i dont if its the correct method (doesnt
take any form of security into account):

Configuration config = ConfigurationMa nager.OpenExeCo nfiguration(pat h);
ConfigurationSe ctionGroup configSectionGr oup =
config.GetSecti onGroup("applic ationSettings") ;
Im using .NET 2.0.

Thanks

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4697
by: Amy L. | last post by:
I have a basic console application that uses a app.exe.config file for all the application settings. The application through several revisions now has over 100 options that are set in the app.exe.config file. We decided to create a Windows Application that will configure this file. Is there any easy way to have have this configuration...
1
2846
by: Paul Fi | last post by:
I have this problem with .NET remoting: my remote class is called RemoteHandler which implements an interface called IEazyRemoting which has only one method to be implemented which is my server configuration file looks like this: <configuration> <system.runtime.remoting> <application> <service>
2
2736
by: Tony Jones | last post by:
Is it possible for me to create a class library DLL and have it read it's configuration settings from the web.config of the ASP.NET application referencing it? IE - if I call ConfigurationSettings.GetConfig("somesection") in one of the base class dll methods, will it/can it return the settings from the web.config? For example, I would...
10
9428
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a ConfigurationErrorException whenever I do the following: 1. Modify and save the section in code using the...
0
1301
by: crackajaxx | last post by:
I've hunted for a while so I'm hoping someone can shed some light on this problem for me. I have an application (not a web-app, in fact this is an installed service) that relies upon its application configuration file to provide it with sensitive information. In this case, the application is talking to a website that requires credentials...
0
3998
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain, but my department has a couple of web servers of our own that are part of my organization's domain. I am trying to read LDAP information on my...
0
8157
by: Lucky | last post by:
Hi guys, I've got a problem under reading settlings from App.config file. I've used System.Configuration to reach to the "User Settings" and "Application Settings" sections. the problem is now I'm not able read the property defined under this section. those are like this User Settings -Testing Application Settings -Test
3
3859
by: Peter K | last post by:
Hi I need to be able to supply some relatively complex configuration to an application. The application will either run in a web context (with a web.config file, or as a application with an app.config). The only configuration reading I have used before is AppSettings and I have also used Spring Framework. It is more the type of...
1
2571
by: MasterLalit | last post by:
Hi, i am using a app.config file in my console application. App.config code--> <configuration> <configSections> <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0,...
0
7711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7628
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7938
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8145
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7694
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1236
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.