Type.GetEnumUnderlyingType 方法

定义

返回当前枚举类型的基础类型。Returns the underlying type of the current enumeration type.

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

返回

当前枚举的基础类型。The underlying type of the current enumeration.

异常

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

-or-

枚举类型无效,因为它包含多个实例字段。The enumeration type is not valid, because it contains more than one instance field.

注解

默认情况下,和中C#的枚举的基础类型 Int32Visual Basic。By default, the underlying type of an enumeration in C# and Visual Basic is Int32. 可以指定其他整数类型。Other integer types can be specified.

适用于