473,382 Members | 1,313 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,382 software developers and data experts.

configuration file custom section handler - a slightly complex XML parsing challenge.

I am trying to create a custom section and section handler in my config
file.

The custom section should be something like;
<appSecurity>
<method name = "Protect the Ice Cream">
<allow group = "admin"/>
<allow group = "ice cream eaters"/>
<deny group= "weightwatchers"/>
<deny user = "hazz"/>
</method>
</appSecurity>

How would I parse this xml in my
Implements IConfigurationSectionHandler where a simple Section Handler looks
like the following;

Dim data As New NameValueCollection()

Dim root As XmlElement = CType(section, XmlElement)

Dim node As XmlNode

For Each node In root.ChildNodes

data.Add(node.Name, node.InnerText)

Next

*************

Thank you,

-greg

ps. I also posted this to the ASP.NET group. While I usually do not cross
post, I thought a C# newsgroup jmight be more appropriate.
Nov 16 '05 #1
1 2131
The context to this question is Rocky's article-> specifically the custom
handler section.
http://msdn.microsoft.com/library/de...et04222003.asp
-greg

"Hazzard" <ha**@sonic.net> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
I am trying to create a custom section and section handler in my config
file.

The custom section should be something like;
<appSecurity>
<method name = "Protect the Ice Cream">
<allow group = "admin"/>
<allow group = "ice cream eaters"/>
<deny group= "weightwatchers"/>
<deny user = "hazz"/>
</method>
</appSecurity>

How would I parse this xml in my
Implements IConfigurationSectionHandler where a simple Section Handler looks like the following;

Dim data As New NameValueCollection()

Dim root As XmlElement = CType(section, XmlElement)

Dim node As XmlNode

For Each node In root.ChildNodes

data.Add(node.Name, node.InnerText)

Next

*************

Thank you,

-greg

ps. I also posted this to the ASP.NET group. While I usually do not cross
post, I thought a C# newsgroup jmight be more appropriate.

Nov 16 '05 #2

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

Similar topics

0
by: Søren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ......
1
by: Hazzard | last post by:
I am trying to create a custom section and section handler in my config file. The custom section should be something like; <appSecurity> <method name = "Protect the Ice Cream"> <allow group =...
0
by: Andy | last post by:
Hi I currently have a large database of capabilities for mobile devices. I would like the MobileCapabilities object to be populated from this database rather than from <browserCaps> section in...
1
by: Andy Emmerson via .NET 247 | last post by:
Hi I am looking to write a custom section handler so that I can populate the MobileCapabilities object from my our custom data rather than the browserCaps section in machine.config. From my...
2
by: murl | last post by:
Below is what i have as the custom section in the web.config file... <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- register local configuration handlers --> <configSections>...
1
by: Ramanfromoz | last post by:
Hi, Developing a new we application. Everything okay on my local WIN XP PROFESSIONAL, IIS 5.0 running locally. The website is running smoothly. Now, the same code I am copying over to a...
6
by: Tabi | last post by:
Hi, I want to create a custom section in my web.config that can hold my custom values. I created a section in web.config as written below. <configSections> <section name="myCustomSection"...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
0
by: towerjj | last post by:
hi all, I need a configuration file mapped to a class in my web app. It is an array of a class, in XML something like this: <ArrayOfRole> <Role> <name>r1</name> <sections>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.