How to retrieve the value of maxRequestLength in the web.config ?

T

toto

Example:
<configuration>
<system.web>
<httpRuntime maxRequestLength="2048" />
</system.web>
</configuration>

I need to kno in my code the value of key maxRequestLength.
Thanks in advance.
 
K

Karl Seguin

Some web.config variables accessible through the framework, like
System.Web.SessionState.SessionStateMode, others, such as the
maxRequestLength are not (as far as I know). Therefore, the only solution
you'll have is to parse the web.config and jump to the value with an
xpath....the good news is since the worker process would restart itself
whenever that file changes, you can do it once in Application_Start and
store the value from that point on...

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top