enum MyEnum { Value1, Value2, } class Program { static void Main(string[] args) { var e = new MyEnum(); string[] values = System.Enum.GetNames(e.GetType()); //... } }
enum MyEnum { Value1, Value2, } class Program { static void Main(string[] args) { var e = new MyEnum(); string[] values = System.Enum.GetNames(e.GetType()); //... } }
转载于:https://www.cnblogs.com/hont/p/5677545.html