SystemWebCachingSectionGroup.Cache 属性

定义

获取配置中包含的 cache 节。

public:
 property System::Web::Configuration::CacheSection ^ Cache { System::Web::Configuration::CacheSection ^ get(); };
[System.Configuration.ConfigurationProperty("cache")]
public System.Web.Configuration.CacheSection Cache { get; }
[<System.Configuration.ConfigurationProperty("cache")>]
member this.Cache : System.Web.Configuration.CacheSection
Public ReadOnly Property Cache As CacheSection

属性值

CacheSection

CacheSection 对象。

属性

示例

下面的代码示例演示如何从现有 Web 应用程序的配置文件中获取 CacheSection 对象。


 // Get the <cache> section.
 CacheSection cache =
     cachingSectionGroup.Cache;

 // Display one of its properties.
 msg = String.Format(
 "Cache disable expiration: {0}\n",
 cache.DisableExpiration);

 Console.Write(msg);
' Get the <cache> section.
Dim cache As CacheSection = _
cachingSectionGroup.Cache

' Display one of its properties.
msg = String.Format( _
"Cache disable expiration: {0}" + _
ControlChars.Lf, cache.DisableExpiration)

Console.Write(msg)

注解

CacheSection 对象是指配置文件中的 cache 部分。 可以使用 CacheSection 类以编程方式修改 cache 节。

适用于

另请参阅