SystemWebCachingSectionGroup 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
配置 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
- 继承
示例
下面的代码示例演示如何从与现有 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 配置文件部分的方法。
该 SystemWebCachingSectionGroup 类和 caching 部分为站点或应用程序提供缓存机制的集中控制。 这样,就可以在不修改应用程序中的各个页面的情况下部署、修改和禁用缓存。
ASP.NET 缓存机制由 Cache 类实现。 有关详细信息,请参阅 ASP.NET 缓存概述。
以下列表描述了 ASP.NET 提供的两种类型的缓存。
第一个称为输出缓存,可用于存储动态页面和用户控件响应。 在后续请求中,不会执行页面或用户控制代码;缓存的输出用于满足请求。 可以使用和OutputCacheSettings属性访问输出缓存设置OutputCache。
第二种类型的缓存是传统的应用程序数据缓存,可用于以编程方式将任意对象存储在服务器内存中,以便应用程序可以节省重新创建它们所需的时间和资源。 可以使用属性访问这些缓存设置 Cache 。
构造函数
| 名称 | 说明 |
|---|---|
| SystemWebCachingSectionGroup() |
创建 SystemWebCachingSectionGroup的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| Cache |
|
| IsDeclarationRequired |
获取一个值,该值指示是否需要此 ConfigurationSectionGroup 对象声明。 (继承自 ConfigurationSectionGroup) |
| IsDeclared |
获取一个值,该值指示是否声明此 ConfigurationSectionGroup 对象。 (继承自 ConfigurationSectionGroup) |
| Name |
获取此 ConfigurationSectionGroup 对象的 name 属性。 (继承自 ConfigurationSectionGroup) |
| OutputCache |
|
| OutputCacheSettings |
|
| SectionGroupName |
获取与此 ConfigurationSectionGroup关联的节组名称。 (继承自 ConfigurationSectionGroup) |
| SectionGroups |
获取一个ConfigurationSectionGroupCollection对象,该对象包含作为此ConfigurationSectionGroup对象的子级的所有ConfigurationSectionGroup对象。 (继承自 ConfigurationSectionGroup) |
| Sections |
获取一个ConfigurationSectionCollection对象,该对象包含此ConfigurationSection对象中的所有ConfigurationSectionGroup对象。 (继承自 ConfigurationSectionGroup) |
| 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) |