Cache.Count 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得快取中儲存的物品數量。
public:
property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
屬性值
快取中儲存的物品數量。
範例
以下範例取得屬性Count的值,將其轉換成字串,並將該字串指派到Text網頁伺服器控制項的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 追蹤功能時非常有用。