Type.GetEnumValues Type.GetEnumValues Type.GetEnumValues Type.GetEnumValues Method

定义

返回当前枚举类型中各个常数的值组成的数组。Returns an array of the values of the constants in the current enumeration type.

public:
 virtual Array ^ GetEnumValues();
public virtual Array GetEnumValues ();
abstract member GetEnumValues : unit -> Array
override this.GetEnumValues : unit -> Array
Public Overridable Function GetEnumValues () As Array

返回

包含值的数组。An array that contains the values. 该数组的元素按枚举常量的二进制值(无符号值)排序。The elements of the array are sorted by the binary values (that is, the unsigned values) of the enumeration constants.

异常

当前类型不是一个枚举。The current type is not an enumeration.

适用于