Cache.Count プロパティ

定義

キャッシュに格納されている項目の数を取得します。

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

プロパティ値

Int32

キャッシュに格納されている項目の数。

次の例では、プロパティの値をCount取得し、文字列に変換し、Web サーバー コントロールLabel1のプロパティにText文字列をLabel割り当てます。

// 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 トレース機能を使用する場合に便利です。

適用対象