DataCacheItem.Key 属性

用于区分缓存或区域中缓存对象的标识符。

命名空间: Microsoft.ApplicationServer.Caching
汇编: Microsoft.ApplicationServer.Caching.Core(在 microsoft.applicationserver.caching.core.dll 中)

用法

语法

声明
Public ReadOnly Property Key As String
public string Key { get; }
public:
property String^ Key {
    String^ get ();
}
/** @property */
public String get_Key ()
public function get Key () : String

属性值

一个字符串值,表示用于区分缓存或区域中缓存对象的标识符。

备注

对于存储在区域中的对象,Key 仅与该特定区域中的其他对象有关。对于未存储在区域中的对象,Key 仅与同一缓存中未存储在区域中的其他对象有关。如果在不同的区域中存储了其他密钥,则同一 Key 可以在缓存中存在多次。

DataCacheItem 类对于更新与对象和并发操作相关联的标记非常有用。有关详细信息,请参阅基于标记的方法 (Velocity)并发方法 (Velocity)

线程安全

此类型的任何公共静态( Visual Basic 中为共享)成员都是线程安全的。不能保证任何实例成员都具有线程安全性。

平台

开发平台

Visual Studio 2010 及更高版本, .NET Framework 4

目标平台

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

另请参阅

参考

DataCacheItem 类
DataCacheItem 成员
Microsoft.ApplicationServer.Caching 命名空间