共用方式為


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

範例

以下程式碼範例展示了如何從現有網頁應用程式所關聯的設定檔取得 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 提供的兩種快取方式。

  • 第一種叫做輸出快取,可以儲存動態頁面和使用者控制回應。 在後續請求中,頁面或使用者控制程式碼不會被執行;快取的輸出用來滿足請求。 你可以透過 OutputCacheOutputCacheSettings 屬性來存取輸出快取設定。

  • 第二種快取是傳統的應用程式資料快取,你可以用程式方式將任意物件儲存到伺服器記憶體,讓應用程式節省重建它們所需的時間和資源。 你可以透過屬性 Cache 存取這些快取設定。

建構函式

名稱 Description
SystemWebCachingSectionGroup()

建立一個新的 實例。SystemWebCachingSectionGroup

屬性

名稱 Description
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)

方法

名稱 Description
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
ForceDeclaration()

強制為此 ConfigurationSectionGroup 物件宣告。

(繼承來源 ConfigurationSectionGroup)
ForceDeclaration(Boolean)

強制為此 ConfigurationSectionGroup 物件宣告。

(繼承來源 ConfigurationSectionGroup)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ShouldSerializeSectionGroupInTargetVersion(FrameworkName)

指示當前實例是否 ConfigurationSectionGroup 應該序列化,當設定物件階層序列化以符合指定目標版本的 .NET 框架時。

(繼承來源 ConfigurationSectionGroup)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

適用於

另請參閱