SystemWebCachingSectionGroup 类

定义

对配置文件中的 caching 组进行配置。 此类不能被继承。

public ref class SystemWebCachingSectionGroup sealed : System::Configuration::ConfigurationSectionGroup
public sealed class SystemWebCachingSectionGroup : System.Configuration.ConfigurationSectionGroup
type SystemWebCachingSectionGroup = class
    inherit ConfigurationSectionGroup
Public NotInheritable Class SystemWebCachingSectionGroup
Inherits ConfigurationSectionGroup
继承
SystemWebCachingSectionGroup

示例

下面的代码示例演示如何从与现有 Web 应用程序关联的配置文件中获取 SystemWebCachingSectionGroup 对象。 可以使用此对象访问组中包含的 caching 节。


// Get the Web application configuration.
System.Configuration.Configuration configuration =
    WebConfigurationManager.OpenWebConfiguration(
    "/aspnetTest");

// Get the <caching> section group.
SystemWebCachingSectionGroup cachingSectionGroup =
  (SystemWebCachingSectionGroup)configuration.GetSectionGroup(
  "system.web/caching");
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")

' Get the <caching> section group.
Dim cachingSectionGroup _
As SystemWebCachingSectionGroup = _
CType(configuration.GetSectionGroup( _
"system.web/caching"), SystemWebCachingSectionGroup)

注解

SystemWebCachingSectionGroup 类提供一种以编程方式访问和修改配置文件的 caching 节的方法。

SystemWebCachingSectionGroupcaching 节提供对站点或应用程序的缓存机制的集中控制。 这样,无需修改应用程序中的各个页面即可部署、修改和禁用缓存。

ASP.NET 缓存机制由 Cache 类实现。 有关详细信息,请参阅 ASP.NET 缓存概述

以下列表描述了 ASP.NET 提供的两种类型的缓存。

  • 第一种称为输出缓存,可用于存储动态页面和用户控件响应。 在后续请求中,不执行页面或用户控制代码;缓存的输出用于满足请求。 可以使用 和 OutputCacheSettings 属性访问输出缓存设置OutputCache

  • 第二种类型的缓存是传统的应用程序数据缓存,可用于以编程方式将任意对象存储在服务器内存中,以便应用程序可以节省重新创建它们所需的时间和资源。 可以使用 属性访问这些缓存设置 Cache

构造函数

SystemWebCachingSectionGroup()

创建 SystemWebCachingSectionGroup 的新实例。

属性

Cache

获取配置中包含的 cache 节。

IsDeclarationRequired

获取一个值,指示是否需要声明此 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
IsDeclared

获取一个值,指示是否已声明此 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
Name

获取此 ConfigurationSectionGroup 对象的名称属性。

(继承自 ConfigurationSectionGroup)
OutputCache

获取配置中包含的 outputCache 节。

OutputCacheSettings

获取配置中包含的 outputCacheSettings 节。

SectionGroupName

获取与此 ConfigurationSectionGroup 关联的节组名称。

(继承自 ConfigurationSectionGroup)
SectionGroups

获取一个 ConfigurationSectionGroupCollection 对象,其中包含作为此 ConfigurationSectionGroup 对象的子对象的所有 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
Sections

获取一个 ConfigurationSectionCollection 对象,其中包含此 ConfigurationSection 对象中的所有 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
SqlCacheDependency

获取配置中包含的 sqlCacheDependency 节。

Type

获取或设置此 ConfigurationSectionGroup 对象的类型。

(继承自 ConfigurationSectionGroup)

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
ForceDeclaration()

强制声明此 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
ForceDeclaration(Boolean)

强制声明此 ConfigurationSectionGroup 对象。

(继承自 ConfigurationSectionGroup)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ShouldSerializeSectionGroupInTargetVersion(FrameworkName)

指示在为.NET Framework的指定目标版本序列化配置对象层次结构时,是否应序列化当前ConfigurationSectionGroup实例。

(继承自 ConfigurationSectionGroup)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅