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.

適用於