//定义一个枚举 public enum Colors { Red, Green, Blue, Yellow };
//根据key找value string name = Enum.GetName(typeof(Colors), 3); //根据value找key int aa = Colors.Yellow.GetHashCode();
时间: 2025-01-03 11:49:52
//定义一个枚举 public enum Colors { Red, Green, Blue, Yellow };
//根据key找value string name = Enum.GetName(typeof(Colors), 3); //根据value找key int aa = Colors.Yellow.GetHashCode();