Cache.Count 屬性

定義

取得快取中所儲存的項目數。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

屬性值

快取中所儲存的項目數。

範例

下列範例會取得 屬性的值 Count 、將它轉換成字串,並將字串指派給 Text Web 服務器控制項的 Label 屬性。 Label1

// Convert the Count property to a string
// and display its value in a Label server control. 
Label1.Text = "The number of items in the cache:" + Cache.Count.ToString();
' Convert the Count property to a string
' and display its value in a Label server control.    
 Label1.Text = "The number of items in the cache:" + Cache.Count.ToString()

備註

當監視應用程式的效能或使用 ASP.NET 追蹤功能時,這個屬性會很有用。

適用於