C#遍历枚举(Enum)值

        foreach (object o in Enum.GetValues(typeof(EmpType)))
        {
            Console.WriteLine("{0}:{1}", o, Enum.Format(typeof(EmpType), o, "D"));
        }

posted @ 2014-09-26 11:22  网事  阅读(222)  评论(0编辑  收藏  举报