如何从codebehind访问的web.config中的httpRuntime节? [英] How to access httpRuntime section of web.config from codebehind?
本文介绍了如何从codebehind访问的web.config中的httpRuntime节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
其实我需要在web.config中的的httpRuntime
部分的的maxRequestLength
值来检查postedfile的大小越大。什么是阅读的最佳方法是什么?
actually i need the maxRequestLength
value of the httpRuntime
section in web.config to check if a postedfile's size is greater. What's the best way to read it?
感谢你在前进。
推荐答案
您可以尝试像
HttpRuntimeSection section = ConfigurationManager.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
那么你可以得到 section.MaxRequestLength
这篇关于如何从codebehind访问的web.config中的httpRuntime节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文