Console.WriteLine("EmpType uses a {0} for storage",
Enum.GetUnderlyingType(typeof(EmpType))); Dynamically Discovering an Enum’s Name/Value Pairs
Beyond the Enum.GetUnderlyingType() method, all C# enumerations support a method named
ToString(), which returns the string name of the current enumeration’s value. For example:
C H A P T E R 4
C O R E C # P R O G R A M M I N G C O N S T R U C T S, PA RT I I
8849CH04.qxd 10/1/07 10:31 AM Page 123
{
Console.WriteLine("**** Fun with Enums *****");