如何枚举一个枚举的成员
如何枚举一个枚举的成员
------解决方案--------------------private void button1_Click(object sender, EventArgs e)
{
goodday g = new goodday();
Array a = Enum.GetValues(g.GetType());
}
public enum goodday
{
morning,noon,afternoon
}
------解决方案--------------------foreach (Type atype in Enum.GetValues(typeof(Type)))
{
}