C# 如何检索非<;应用程序设置>;web.config中的密钥?

C# 如何检索非<;应用程序设置>;web.config中的密钥?,c#,asp.net,.net,web-config,C#,Asp.net,.net,Web Config,我的web.config中有以下内容: <configuration> <system.web> <httpRuntime executionTimeout="180"/> </system.web> </configuration> 是否有.NET内置的方法来检索executionTimeout值?可能通过ConfigurationManager对象集?我没有看到任何明显的内容。任何部分都可以通过

我的web.config中有以下内容:

<configuration>
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</configuration>


是否有.NET内置的方法来检索
executionTimeout
值?可能通过ConfigurationManager对象集?我没有看到任何明显的内容。

任何部分都可以通过使用

在Web应用程序中,我们可以使用同样具有类似API的


可以使用

在Web应用程序中,我们可以使用同样具有类似API的

var httpRuntimeSection = ConfigurationManager.GetSection("system.web/httpRuntime") as 
HttpRuntimeSection;

//httpRuntimeSection.ExecutionTimeout