OutputCacheSettingsSection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
配置应用程序页的输出缓存设置。 此类不能被继承。
public ref class OutputCacheSettingsSection sealed : System::Configuration::ConfigurationSection
public sealed class OutputCacheSettingsSection : System.Configuration.ConfigurationSection
type OutputCacheSettingsSection = class
inherit ConfigurationSection
Public NotInheritable Class OutputCacheSettingsSection
Inherits ConfigurationSection
- 继承
示例
下面的代码示例演示如何从现有 Web 应用程序的配置文件中获取 OutputCacheSettingsSection 对象。
// Get the Web application configuration.
System.Configuration.Configuration webConfig =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
string configPath =
"system.web/caching/outputCacheSettings";
System.Web.Configuration.OutputCacheSettingsSection outputCacheSettings =
(System.Web.Configuration.OutputCacheSettingsSection)webConfig.GetSection(
configPath);
' Get the Web application configuration.
Dim webConfig _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim configPath As String = _
"system.web/caching/outputCacheSettings"
Dim outputCacheSettings _
As System.Web.Configuration.OutputCacheSettingsSection = _
CType(webConfig.GetSection(configPath), _
System.Web.Configuration.OutputCacheSettingsSection)
注解
类 OutputCacheSettingsSection 允许以编程方式访问和修改 outputCacheSettings 配置文件中节的 caching 元素。 输出缓存设置定义存储在缓存中的项与文件、缓存键或
注释
可以根据OutputCacheSettingsSection属性值AllowDefinition为的节属性MachineToApplication定义的限制,将信息写入配置文件的相关节。 在层次结构中不允许的某个级别的配置文件中写入的任何尝试都将导致分析程序生成的错误消息。 但是,可以使用此类在层次结构中的任何级别读取配置信息。
构造函数
| 名称 | 说明 |
|---|---|
| OutputCacheSettingsSection() |
初始化 OutputCacheSettingsSection 类的新实例。 |