Type.GetEnumNames Type.GetEnumNames Type.GetEnumNames Type.GetEnumNames Method

定义

返回当前枚举类型中各个成员的名称。Returns the names of the members of the current enumeration type.

public:
 virtual cli::array <System::String ^> ^ GetEnumNames();
public virtual string[] GetEnumNames ();
abstract member GetEnumNames : unit -> string[]
override this.GetEnumNames : unit -> string[]
Public Overridable Function GetEnumNames () As String()

返回

String[]

一个数组,其中包含枚举中各个成员的名称。An array that contains the names of the members of the enumeration.

异常

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

注解

返回值数组的元素按枚举常量的二进制值 (即,无符号值)。The elements of the return value array are sorted by the binary values (that is, the unsigned values) of the enumerated constants. 如果数组包含具有相同值的枚举的常数,则不指定其相应名称的顺序。If the array contains enumerated constants with the same value, the order of their corresponding names is unspecified.

适用于