OutputCacheProfileCollection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示 OutputCacheProfile 物件的集合。 此類別無法獲得繼承。
public ref class OutputCacheProfileCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.OutputCacheProfile))]
public sealed class OutputCacheProfileCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.OutputCacheProfile))>]
type OutputCacheProfileCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class OutputCacheProfileCollection
Inherits ConfigurationElementCollection
- 繼承
- 屬性
範例
下列程式代碼範例示範如何取得 OutputCacheProfileCollection 物件。
// Get the Web application configuration.
System.Configuration.Configuration webConfig =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
string configPath =
"system.web/caching/outputCacheSettings";
System.Web.Configuration.OutputCacheSettingsSection outputCacheSettings =
(System.Web.Configuration.OutputCacheSettingsSection)webConfig.GetSection(
configPath);
// Get the profile collection.
System.Web.Configuration.OutputCacheProfileCollection outputCacheProfiles =
outputCacheSettings.OutputCacheProfiles;
' ' Get the Web application configuration.
Dim webConfig _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim configPath As String = _
"system.web/caching/outputCacheSettings"
Dim outputCacheSettings _
As System.Web.Configuration.OutputCacheSettingsSection = _
CType(webConfig.GetSection(configPath), _
System.Web.Configuration.OutputCacheSettingsSection)
' Get the profile collection.
Dim outputCacheProfiles _
As System.Web.Configuration.OutputCacheProfileCollection = _
outputCacheSettings.OutputCacheProfiles
備註
OutputCacheProfileCollection允許集中管理頁面或使用者控件所使用的輸出快取設定。
它可讓您以程式設計方式存取和修改 OutputCacheProfile 它所包含的物件。
注意
OutputCacheProfile可以使用 @ OutputCache 指示詞的 屬性,將 套用至頁面CacheProfile。
建構函式
| OutputCacheProfileCollection() |
初始化 OutputCacheProfileCollection 類別的新執行個體。 |
屬性
方法
明確介面實作
| ICollection.CopyTo(Array, Int32) |
將 ConfigurationElementCollection 複製至陣列。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別來篩選 IEnumerable 的項目。 |
| AsParallel(IEnumerable) |
啟用查詢的平行化作業。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |