CacheDependency.GetUniqueID メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim instance As CacheDependency Dim returnValue As String returnValue = instance.GetUniqueID
CacheDependency オブジェクトの一意の識別子。

このメソッドは、項目またはアプリケーションに関連付けられている CacheDependency クラスの複数インスタンスを追跡する場合に特に役立ちます。
識別子は、ファイル名 (ファイルに依存する場合) またはキー名 (キャッシュ キーに依存する場合) のいずれかと、このメソッドが依存関係に割り当てる文字列の組み合わせです。CacheDependency クラスから派生するクラスでは、このメソッドをオーバーライドして一意の識別子の生成方法をカスタマイズできます。

配列内に 2 つの CacheDependency オブジェクトを持つ、aggDep という名前の AggregateCacheDependency オブジェクトを作成するコード例を次に示します。aggDep がインスタンス化されたら、このコードは GetUniqueID メソッドを呼び出し、aggDep に含まれている 2 つの依存関係に対して一意の識別子を生成し、その識別子を格納ページに表示します。次に、Cache.Insert メソッドを使用して、aggDep と依存関係を持つ Cache に項目が追加されます。
' Create two CacheDependency objects, one to a ' text file and the other to an XML file. ' Create a CacheDependency array with these ' two objects as items in the array. txtDep = New CacheDependency(Server.MapPath("Storage.txt")) xmlDep = New CacheDependency(Server.MapPath("authors.xml")) Dim DepArray() As CacheDependency = {txtDep, xmlDep} ' Create an AggregateCacheDependency object and ' use the Add method to add the array to it. aggDep = New AggregateCacheDependency() aggDep.Add(DepArray) ' Call the GetUniqueId method to generate ' an ID for each dependency in the array. msg1.Text = aggDep.GetUniqueId() ' Add the new data set to the cache with ' dependencies on both files in the array. Cache.Insert("XMLDataSet", Source, aggDep)

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCacheDependency.GetUniqueID メソッドを検索する場合は、下記のリンクをクリックしてください。

- CacheDependency.GetUniqueID メソッドのページへのリンク