GetEnumUnderlyingType Method
TOC
Collapse the table of content
Expand the table of content

Type.GetEnumUnderlyingType Method ()

.NET Framework (current version)
 

Returns the underlying type of the current enumeration type.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public virtual Type GetEnumUnderlyingType()

Return Value

Type: System.Type

The underlying type of the current enumeration.

Exception Condition
ArgumentException

The current type is not an enumeration.

-or-

The enumeration type is not valid, because it contains more than one instance field.

By default, the underlying type of an enumeration in C# and Visual Basic is Int32. Other integer types can be specified.

.NET Framework
Available since 4.0
Return to top
Show:
© 2016 Microsoft