Type.GetEnumUnderlyingType Method

Definition

傳回目前列舉類型的基礎類型。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

Returns

Type

目前列舉的基礎類型。The underlying type of the current enumeration.

Exceptions

目前的類型不是列舉。The current type is not an enumeration.

-或--or-

列舉類型無效,因為它包含一個以上的執行個體欄位。The enumeration type is not valid, because it contains more than one instance field.

Remarks

根據預設,和 Visual Basic 中C#列舉的基礎類型是 Int32By default, the underlying type of an enumeration in C# and Visual Basic is Int32. 可以指定其他整數類型。Other integer types can be specified.

Applies to