标签:
C#中,如何获取(遍历)枚举中所有的值:
public enum Suits { Spades, Hearts, Clubs, Diamonds, NumSuits } private static void Main(string[] args) { foreach (Suits suit in Enum.GetValues(typeof(Suits))) { Console.WriteLine((int)suit+ ":" + suit); } }
标签:
原文地址:http://www.cnblogs.com/zhangzhi19861216/p/5362090.html