loop through a .NET Enum object

Here's how to loop through a .NET Enum object.

///////////////////////
VB.NET
///////////////////////

Dim appType As Common.INTEL_APP
  
ForEach appType In [Enum].GetValues(GetType(Common.INTEL_APP))
    SetPermissions(appType)
Next

///////////////////////
C#
///////////////////////

foreach (Common.INTEL_APP appType in System.Enum.GetValues(typeof(Common.INTEL_APP)))
    SetPermissions(appType)
}
 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name (required)

 Email (will not be published) (required)

Your comment is 0 characters limited to 3000 characters.