共用方式為


Cache.Count 屬性

定義

會取得快取中儲存的物品數量。

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 追蹤功能時非常有用。

適用於