获取枚举的长度方法

        public enum typeList
        {
            type1,
            type2,
            type3
        }

Response.Write(Enum.GetNames(typeof(typeList)).Length);

原文地址:https://www.cnblogs.com/ccsbb/p/1873839.html