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); } }
标签:string logs type ring get img body tool title
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); } }
标签:string logs type ring get img body tool title
原文地址:https://www.cnblogs.com/chengqi521/p/8243016.html