Posts
391
Comments
137
Trackbacks
0
Über eine Enumeration iterieren

Falls ich das mal wieder brauche, Beispiel wie man über eine Enumeration iteriert:

class Program
{  
   public
enum
farben
   {
      rot,
      blau,
      gruen
   }
  

   static void Main(string[] args)
   {
   
      foreach (farben farbe in Enum.GetValues(typeof(farben)))
      {
        
Console
.WriteLine(farbe.ToString());
      }
      Console
.ReadLine();
   }
}

posted on Friday, October 02, 2009 5:55 PM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 8 and 4 and type the answer here: