Cache.Count プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)

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

名前空間: System.Web.Caching
アセンブリ: System.Web (system.web.dll 内)
構文構文

Visual Basic (宣言)

Public ReadOnly Property Count As Integer

Visual Basic (使用法)

Dim instance As Cache Dim value As Integer

value = instance.Count

C#

public int Count { get; }

C++

public: property int Count { int get (); }

J#

/** @property */ public int get_Count ()

JScript

public function get Count () : int

プロパティ
キャッシュ内に格納されている項目の数。

解説解説

このプロパティは、アプリケーションパフォーマンス監視する場合や、ASP.NETトレース機能使用する場合役立ちます

使用例使用例

Count プロパティの値を取得して文字列変換し、この文字列Label Web サーバー コントロール (Label1) の Text プロパティ設定する例を次に示します

Visual Basic

' 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:"

C#

// 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();

プラットフォームプラットフォーム

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォーム中には.NET Framework によってサポートされていないバージョンありますサポートされているバージョンについては、「システム要件」を参照してください

バージョン情報バージョン情報

.NET Framework
サポート対象 : 2.01.11.0

参照参照

関連項目
Cache クラス
Cache メンバ
System.Web.Caching 名前空間