共用方式為


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 區段。

適用於

另請參閱