1//By Value 2foreach (int i in Enum.GetValues(typeof(Colors))) 3{ 4 Console.WriteLine(i); 5} 6 7//By Name 8foreach (string s in Enum.GetNames(typeof(Colors))) 9{ 10 Console.WriteLine(s); 11} 12