473,666 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Iterating Across All Data in Configuration File

Hello,

Using ConfigurationSe ttings.AppSetti ngs.keys I can iterate across the
default AppSettings section of the XML config file.

I need to iterate across all key value pairs in other sections as well.
If I use:

ConfigurationSe ttings.GetConfi g("path..") as Hashtable;

it doesn't seem to work. Is there any way to do this?

Dec 20 '05 #1
2 1527
You could open the file using an XmlReader. It is designed to iterate
over an XML document.
Dec 21 '05 #2
I found a solution, thanks all for help. It only took me 3 hrs...

In <configSectio n> specify your type as
"System.Configu ration.Dictiona rySectionHandle r". Then
ConfigurationSe ttings.GetConfi g(type) will return a hash.

Dec 21 '05 #3

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

Similar topics

3
1811
by: Antony Sequeira | last post by:
Hi I needed to share some configuration information across requests. The most straightforward way would be code it in a php file and include it in every other script. The problem with this approach is, the configuration script is executed on every request. The configuration data once figured out by the script remains the same for a host, but the script to figure out the data could be arbitrarily complex. The only mechanism I have...
1
2495
by: Jonathan Hayward | last post by:
Just after posting the previous request, I realised that my test case worked after I added flushes. The next problem I have is that, in the real program, the server gets an EOFError when it first tries to read from the socket. Relevant portions follow the error message below: Traceback (most recent call last): File "/var/www/cgi-bin/datamine", line 1633, in ? find_and_output_appropriate_page() File "/var/www/cgi-bin/datamine", line...
12
11707
by: Matthew Wilson | last post by:
I'm playing around with genetic algorithms and I want to write a function that mutates an integer by iterating across the bits, and about 1 in 10 times, it should switch a zero to a one, or a one to a zero. I'm not sure how many bits are inside a python integer. The library reference says at least 32. I'm thinking about writing a function that eats integers and poops out lists of bools; and then I can iterate through that, and change...
1
360
by: Raymond Cheung | last post by:
How do I disable to show xml file content on web browser from across domain. I know we can have some sort of enbcription on the xml file content. I also know that we can use authentication to control the display of xml file. However, I want to assume the user is authenticated in the directory where I have the haha.xml file. Yet, the user would not be able to see the content of the xml file as below ie) When some one type ...
7
1690
by: Dave Hansen | last post by:
OK, first, I don't often have the time to read this group, so apologies if this is a FAQ, though I couldn't find anything at python.org. Second, this isn't my code. I wouldn't do this. But a colleague did, got an unexpected result, and asked me why. I think I can infer what is occurring, and I was able to find a simple work-around. But I thought I'd ask about it anyway. I've been pushing Python at work for use as a scripting...
2
301
by: Mervin Williams | last post by:
I am using Infragistics UltraWebTab (a tab folder control for ASP.NET). My tab folder control will include five tab pages with a separate web form on each, and these web forms will share data. My questions regard the data tier, that is, how I should construct the data objects so as to reduce memory usage while optimizing page performance? 1. I'll be using data sets. How can I share a single data set across the multiple web forms? 2....
0
249
by: shawnn | last post by:
Hello, Using ConfigurationSettings.AppSettings.keys I can iterate across the default AppSettings section of the XML config file. I need to iterate across all key value pairs in other sections as well. If I use: ConfigurationSettings.GetConfig("path..") as Hashtable;
13
1856
by: Eric Renken | last post by:
I currently use statements like this in my 1.1 code. System.Configuration.ConfigurationSettings.AppSettings I use this in DLLs that are referenced by the application. The application has this data in its app.config file. I would like to switch to the new Setting files in 2.0, but I don't know if I can access these settings from a different DLL. I can't make a reference in the DLL back to the application because that would create a...
5
2703
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest XML config file problem that I really need help with. I'm supporting a .NET 1.1 desktop application with its own config file, and I implement IConfigurationSectionHandler so I can have a custom config section in my config file. The IConfigurationSectionHandler.Create method just returns the 'section' XmlNode back to the consumer. The config file looks kind of like this: <?xml version="1.0" encoding="utf-8" ?>...
0
8440
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8550
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
7381
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...
1
6191
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4193
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
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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
2006
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.