如何将枚举变量转换成数组?
同上。谢谢! --------------------编程问答-------------------- string[] names=Enum.GetNames(); --------------------编程问答-------------------- string[] names=Enum.GetNames("EnumName");--------------------编程问答-------------------- Enum.GetValues(...) --------------------编程问答-------------------- enum Colors { Red, Green, Blue, Yellow };
foreach (string s in Enum.GetNames(typeof(Colors)))
Console.WriteLine(s); --------------------编程问答-------------------- Enum.GetNames(typeof(enumName));
补充:.NET技术 , C#