Type.GetEnumUnderlyingType 方法

定义

返回当前枚举类型的基础类型。

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

返回

当前枚举的基础类型。

例外

当前类型不是枚举。

-或-

枚举类型无效,因为它包含多个实例字段。

注解

默认情况下,C# 和 Visual Basic 中枚举的基础类型为 Int32。 可以指定其他整数类型。

适用于