469,649 Members | 1,177 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Reading a Element Collection From a App.config file

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, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
<sources>
<add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common .Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
filePath="CS.config" />
<add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common .Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</sources>
</enterpriseLibrary.ConfigurationSource>

</configuration>

in the above code one config section "enterpriseLibrary.ConfigurationSource" is present. with in this elements collection ("sources"). i want to get the value of the filePath i.e CS.Config present in side the "Sources" element in my console application.

can any one help me in getting the values from app.config file.
Thanks alot in advance.
Sep 28 '08 #1
1 2345
joedeene
583 512MB
...so are you asking, basically, how to read the values from the App.config file? how about looking into the system.configuration.ConfigurationManager class? you might find it useful...

joedeene
Sep 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jeff Thies | last post: by
reply views Thread by chris.millar | last post: by
2 posts views Thread by news.microsoft.com | last post: by
5 posts views Thread by Kevin S Gallagher | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.