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

Reading portions of the web.config file

Is there any way, from a web application to programatically access the
httpHandlers section in the applications web.config file? Specifically I
want find, at run time, the value of the path variable in the "<add
vert=...." line.

<httpHandlers>

<add verb="POST,GET" path="test/*.ashx" type="MyAssembly.MyClass, Test" />

</httpHandlers>

Nov 19 '05 #1
1 871
The file is xml, so you can read through it like any xml file using xpath.

http://www.dotnetjohn.com/articles.aspx?articleid=154

You could easily cheat by having an appsettings value with it in and read
that instead.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Jeremy Chapman" <No****@Please.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Is there any way, from a web application to programatically access the
httpHandlers section in the applications web.config file? Specifically I
want find, at run time, the value of the path variable in the "<add
vert=...." line.

<httpHandlers>

<add verb="POST,GET" path="test/*.ashx" type="MyAssembly.MyClass, Test" />

</httpHandlers>

Nov 19 '05 #2

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

Similar topics

1
by: Nadie | last post by:
Greeting list readers, I noticed that the wave read object has an *implementation dependent* setpos(pos) method. When reading audio files, it is useful to be able to set the position to a...
0
by: Venkatesh | last post by:
Hi I have a section in my app.config file that stores information about executing certain stored procedures that get cached using Microsoft.ApplicationBlocks.cache, a sample of which is shown...
3
by: spacekid | last post by:
Hi there I am exposing a c# assembly as a COM component (regasm /codebase) and calling it from classic asp. When I try to call the ConfigurationSettings.AppSettings function in the c# assembly,...
1
by: vijayarl | last post by:
Hi Everyone, i have the written this logic : basically a file operation open (CONFIGFILE, "$config_file") or die; while (<CONFIGFILE>) { chomp;
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.