获取枚举的长度方法

        public enum typeList
        {
            type1,
            type2,
            type3
        }

 

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

posted on 2010-11-10 16:00  锥子  阅读(1138)  评论(0编辑  收藏  举报