473,804 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ConfigurationSe ttings.GetConfi g .Net 2.0 equivalent

Hi

Anyone know the equivalent to

NameValueCollec tion nvc = ConfigurationSe ttings.GetConfi g(
"SectionGro up/Section" ) as NameValueCollec tion;

in .Net 2.0. All the examples I've seen involve creating a customer
handler.

Surely there's still a simple way of obtaining key/pair values, but I just
can't seem to find it.

Thanks

Glenn
Jun 1 '06 #1
2 6465
*custom, although the idea of a customer handler is intriguing.
"Glenn" <gl*********@ya hoo.co.uk> wrote in message
news:ew******** ******@TK2MSFTN GP05.phx.gbl...
Hi

Anyone know the equivalent to

NameValueCollec tion nvc = ConfigurationSe ttings.GetConfi g(
"SectionGro up/Section" ) as NameValueCollec tion;

in .Net 2.0. All the examples I've seen involve creating a customer
handler.

Surely there's still a simple way of obtaining key/pair values, but I just
can't seem to find it.

Thanks

Glenn

Jun 1 '06 #2
Easy really, once the hangovers gone.

NameValueCollec tion nvc = ConfigurationMa nager.GetSectio n(
"SectionGro up/Section" ) as NameValueCollec tion;
string value = nvc.Get( "Key" )

"Glenn" <gl*********@ya hoo.co.uk> wrote in message
news:ew******** ******@TK2MSFTN GP05.phx.gbl...
Hi

Anyone know the equivalent to

NameValueCollec tion nvc = ConfigurationSe ttings.GetConfi g(
"SectionGro up/Section" ) as NameValueCollec tion;

in .Net 2.0. All the examples I've seen involve creating a customer
handler.

Surely there's still a simple way of obtaining key/pair values, but I just
can't seem to find it.

Thanks

Glenn

Jun 1 '06 #3

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

Similar topics

3
2134
by: serge calderara | last post by:
Dear all, I have define a configuration file for my application with different section groups and settings belonging to each individual group like as follow : ===================================================== <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections>
0
1239
by: Keith Patrick | last post by:
If I call ConfigurationSettings.GetConfig(...) the first time, it works fine, demanding no permissions. However, if I call it again for a different section, it demands FileIOPermission Read/PathDiscovery permission to the app's directory (kind of difficult to assign this permission to the assembly in this case). Is this a bug or intended behavior? I don't really see why a second call would be any different from the first, unless there is...
3
3136
by: Filippo | last post by:
Hi there, I am writing a Windows App and need a Configuration file. I wonder if I can use the WEB.CONFIG file to store my values. I also wonder if I can use the ConfigurationSettings.AppSettings and if so, what is the file name that it automatically look for. Thanks, Filippo
9
5080
by: james | last post by:
According to the documentation ConfigurationSetting.GetConfig( string ) is used to get user defined config settings. Yet, no matter how I try to add my own sections to the app.config I keep getting errors stating an invalid config file section found. So, can someone elighten me as to how this is to be used ?? thanks JIM
2
6410
by: Mythran | last post by:
public static void Main() { string sectionName = "system.web"; object settings = ConfigurationSettings.GetConfig(sectionName); Console.WriteLine( settings == null ? "(null)" : settings.GetType().ToString() ); }
2
1300
by: J Holsinger | last post by:
In VB.Net solution I have Standard Windows app and a Web app that references a Class library. Both the Win app and the class library use the same technique in the code files for retrieving identical custom config sections in their respective app.config's. The win app runs without error, the class library being used in the web app can't parse it's own app.config. Does anybody know what would cause behavior like that? -- thx -jsh
0
1304
by: Steph | last post by:
hello, in .NET1 i used this command for read a specific xml file config: ConfigurationSettings.GetConfig how to make in .NET 2 ? keep in mind : i need to read a specific file not the wep.config or other .dotnet config file.. thx mau
8
2651
by: Mark | last post by:
Could someone provide me with details or a link on how the line of code executes underneath the hood? Assume it's executed in an ASP.NET application. string blah = ConfigurationSettings.AppSettings Once your application has called for the "foo" key once, how expensive is to call the same line again? My gut tells me that the CLR likely stores these values in memory in a string dictionary or similar. Looking up the value requires the...
1
5823
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add key="company" value="Hyundai" /> <add key="Hyundai" value="sonata" />
0
10594
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.