Can anyone explain this?
alt text http://www.deviantsart.com/upload/g4knqc.png
using System;
namespace TestEnum2342394834
{
class Program
{
According to the MSDN documentation, the overload of Console.WriteLine that takes an object internally calls ToString on its argument.
When you do foreach (var value in ...), your value variable is typed as object (since, as SLaks points out, Enum.GetValues returns an untyped Array) and so your Console.WriteLine is calling object.ToString which is overriden by System.Enum.ToString. And this method returns the name of the enum.
When you do foreach (int value in ...), you're casting the enum values to int values (instead of object); so Console.WriteLine is calling System.Int32.ToString.