BitArray.Item 属性

获取或设置 BitArray 中特定位置的位的值。

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

语法

声明
Public Default Property Item ( _
    index As Integer _
) As Boolean
用法
Dim instance As BitArray
Dim index As Integer
Dim value As Boolean

value = instance(index)

instance(index) = value
public bool this [
    int index
] { get; set; }
public:
property bool default [int] {
    bool get (int index);
    void set (int index, bool value);
}
/** @property */
public boolean get_Item (int index)

/** @property */
public void set_Item (int index, boolean value)
JScript 支持使用索引属性,但不支持进行新的声明。

参数

  • index
    要获取或设置的值的从零开始的索引。

属性值

在 index 位置处的位的值。

异常

异常类型 条件

ArgumentOutOfRangeException

index 小于零。

- 或 -

index 等于或大于 Count

备注

通过使用下面的语法,此属性提供访问集合中特定元素的能力:myCollection[index]

检索此属性值的运算复杂度为 O(1);设置此属性的运算复杂度也是 O(1)。

平台

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

请参见

参考

BitArray 类
BitArray 成员
System.Collections 命名空间
BitArray.Count 属性