Type.GetEnumUnderlyingType Type.GetEnumUnderlyingType Type.GetEnumUnderlyingType Type.GetEnumUnderlyingType Method

定义

返回当前枚举类型的基础类型。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# 和 Visual Basic 中枚举的基础类型是Int32By default, the underlying type of an enumeration in C# and Visual Basic is Int32. 可以指定其他整数类型。Other integer types can be specified.

适用于