IDictionaryEnumerator.Entry 属性

同时获取当前字典项的键和值。

**命名空间:**System.Collections
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
ReadOnly Property Entry As DictionaryEntry
用法
Dim instance As IDictionaryEnumerator
Dim value As DictionaryEntry

value = instance.Entry
DictionaryEntry Entry { get; }
property DictionaryEntry Entry {
    DictionaryEntry get ();
}
/** @property */
DictionaryEntry get_Entry ()
function get Entry () : DictionaryEntry

属性值

同时包含当前字典项的键和值的 DictionaryEntry

异常

异常类型 条件

InvalidOperationException

IDictionaryEnumerator 定位于字典的第一项之前或最后一项之后。

备注

创建枚举数或调用 Reset 方法后,必须先通过调用 MoveNext 方法来使枚举数前进到集合的第一个元素,然后才能读取 Entry 属性的值;否则 Entry 是不确定的。

如果对 MoveNext 的上一次调用返回 false(它指示集合的结尾),则 Entry 也会引发异常。

Entry 不移动枚举数的位置,而且在调用 MoveNextReset 之前,对 Entry 的连续调用返回相同的对象。

给实现者的说明IEnumerator 继承的 Current 属性返回一个 Object,此返回值是一个已装箱的 DictionaryEntry,与 Entry 属性的返回值类似。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、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.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

IDictionaryEnumerator 接口
IDictionaryEnumerator 成员
System.Collections 命名空间
Reset
MoveNext
Key
Value